Re: [PATCH 2.5.6] New wireless driver API part 2

Jean Tourrilhes (jt@bougret.hpl.hp.com)
Mon, 11 Mar 2002 14:02:44 -0800


On Mon, Mar 11, 2002 at 04:50:11PM -0500, Jeff Garzik wrote:
> Jean Tourrilhes wrote:
>
> Overall looks good. My only minor objection would be that this function
> should return an error value. Clearly the kmalloc can fail, at least.
>
> Jeff

Thanks for the quick review (as usual), very much appreciated.

Now, for the return value...
I've debated this precise point. Here is the comment that I
wrote in the code you just quoted :
/* Note : we don't return an error to the driver, because
* the driver would not know what to do about it. It can't
* return an error to the user, because the event is not
* initiated by a user request.
* The best the driver could do is to log an error message.
* We will do it ourselves instead...
*/
The failure to deliver an event to the user is not critical,
and I don't really see what the driver code would do with a return
code. In fact, event delivery to user space is not reliable (netlink
may drop it in case its queues are full - this is more likely than
kmalloc failure), and my code only check a few of those failure
conditions, so the driver has no way to know if the message reached
its intended destination.
In fact, I eliminated the return code *on purpose*, to prevent
driver writer to do stupid things (like shutting down the driver) or
adding additional log message (waste at this point).
Convincing enough ?

Have fun...

Jean
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/