]> git.baikalelectronics.ru Git - kernel.git/commit
HID: Consolidate device existence checks in hiddev_ioctl
authorValentine Barshak <vbarshak@mvista.com>
Mon, 6 Dec 2010 15:16:11 +0000 (18:16 +0300)
committerJiri Kosina <jkosina@suse.cz>
Tue, 7 Dec 2010 14:45:50 +0000 (15:45 +0100)
commitbb5076fb40950c8a57eebac3434992c85c1a6668
treef863fc60990f851bb7d9af3d9b4791c80634becb
parent3ea5f978f8440d7de0df93040f498b6665729913
HID: Consolidate device existence checks in hiddev_ioctl

Currently, if the device has been removed before hiddev_ioctl(),
the -EIO is returned. If it's removed while hiddev_ioctl() is in
progress, some commands are still processed fine, others
return -ENODEV. This change takes the "existancelock" before
processing ioctl commands and releases it at the end.
If the device has been removed, always returns -ENODEV.

Signed-off-by: Valentine Barshak <vbarshak@mvista.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hiddev.c