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/