HID: hidraw: fix window in hidraw_release
authorJiri Slaby <jslaby@suse.cz>
Tue, 19 Oct 2010 09:29:55 +0000 (11:29 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 20 Oct 2010 14:54:04 +0000 (16:54 +0200)
commitcb174681a9ececa6702f114b85bdf82144b6a5af
tree569ab434de51b3d323de65426f8cd55281b9e765
parenta850ea30374ebed32a0724742601861853fde869
HID: hidraw: fix window in hidraw_release

There is a window between hidraw_table check and its dereference.
In that window, the device may be unplugged and removed form the
system and we will then dereference NULL.

Lock that place properly so that either we get NULL and jump out or we
can work with real pointer.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hidraw.c