summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2009-04-29 17:12:12 +0200
committerJiri Kosina <jkosina@suse.cz>2009-04-29 17:25:01 +0200
commit89092ddd7aca598e3b8874f7a49216e7917d8f3f (patch)
tree138fe216f5659a8022bf45cc319e18a3e0595a2e /drivers/hid
parent2feaace40e5c3133fea795333402f30929a200d9 (diff)
HID: fix possible deadlock in usbhid_close()
This patch switches usbhid_close() from flush_scheduled_work() to canceling the outstanding work. This fixes a possible deadlock due to work taking the mutex usbhid_close() holds. Lockdep reported the problem. Signed-off-by: Oliver Neukum <oliver@neukum.org> -- Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/usbhid/hid-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 4306cb1b8ce..900ce18dd54 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -662,8 +662,8 @@ void usbhid_close(struct hid_device *hid)
spin_lock_irq(&usbhid->lock);
if (!--hid->open) {
spin_unlock_irq(&usbhid->lock);
+ hid_cancel_delayed_stuff(usbhid);
usb_kill_urb(usbhid->urbin);
- flush_scheduled_work();
usbhid->intf->needs_remote_wakeup = 0;
} else {
spin_unlock_irq(&usbhid->lock);