Re: [PATCH 3/4] HID: debug: empty output queue on read

2013-04-18 Thread Jiri Kosina
On Wed, 17 Apr 2013, Benjamin Tissoires wrote: > If an event occurs while the hid debugfs is forwarding events, list->tail > is updated during copy_to_user(). > > Remove the gotos and use a regular while-loop to empty the queue. > > Second benefit, it checks that we are not writing more than

Re: [PATCH 3/4] HID: debug: empty output queue on read

2013-04-18 Thread Jiri Kosina
On Wed, 17 Apr 2013, Benjamin Tissoires wrote: If an event occurs while the hid debugfs is forwarding events, list-tail is updated during copy_to_user(). Remove the gotos and use a regular while-loop to empty the queue. Second benefit, it checks that we are not writing more than count

[PATCH 3/4] HID: debug: empty output queue on read

2013-04-17 Thread Benjamin Tissoires
If an event occurs while the hid debugfs is forwarding events, list->tail is updated during copy_to_user(). Remove the gotos and use a regular while-loop to empty the queue. Second benefit, it checks that we are not writing more than count bytes to the user-space output buffer. Signed-off-by:

[PATCH 3/4] HID: debug: empty output queue on read

2013-04-17 Thread Benjamin Tissoires
If an event occurs while the hid debugfs is forwarding events, list-tail is updated during copy_to_user(). Remove the gotos and use a regular while-loop to empty the queue. Second benefit, it checks that we are not writing more than count bytes to the user-space output buffer. Signed-off-by: