Johannes Weiner 96fe2ab830 HID: fix waitqueue usage in hiddev
DECLARE_WAITQUEUE doesn't initialize the wait descriptor's task_list
to 'empty' but to zero.

prepare_to_wait() will not enqueue the descriptor to the waitqueue and
finish_wait() will do list_del_init() on a list head that contains
NULL pointers, which oopses.

This was introduced by 079034073 "HID: hiddev cleanup -- handle all
error conditions properly".

The prior code used an unconditional add_to_waitqueue() which didn't
care about the wait descriptor's list head and enqueued the thing
unconditionally.

The new code uses prepare_to_wait() which DOES check the prior list
state, so use DEFINE_WAIT instead.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-10 22:44:01 +01:00
..
2009-01-08 16:29:41 +00:00
2009-02-02 23:26:57 -08:00
2009-01-29 18:04:43 -08:00
2009-03-10 22:44:01 +01:00
2009-01-11 01:34:25 +01:00
2009-01-15 16:39:40 -08:00
2009-01-09 03:39:43 -05:00
2009-02-02 19:53:02 +03:00
2009-02-11 14:25:36 -08:00
2009-01-30 08:40:54 -08:00
2009-02-11 14:25:37 -08:00