HID: usbhid: cancel timer for retry synchronously
authorOliver Neukum <oliver@neukum.org>
Thu, 13 Oct 2011 16:21:58 +0000 (18:21 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 13 Oct 2011 16:21:58 +0000 (18:21 +0200)
This makes sure IO is never restarted while a reset is going on

In particular there seems to be no protection from hid_retry_timeout() calling
hid_start_in() which would start IO after hid_pre_reset() has already called
hid_cease_io() because that uses del_timer(), not del_timer_sync()

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hid-core.c

index ad978f5748d3211e4eeb14992806a5a912682040..77e705c2209c6ae991e9ba3c6ae36fa174786318 100644 (file)
@@ -1270,7 +1270,7 @@ static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
 
 static void hid_cease_io(struct usbhid_device *usbhid)
 {
-       del_timer(&usbhid->io_retry);
+       del_timer_sync(&usbhid->io_retry);
        usb_kill_urb(usbhid->urbin);
        usb_kill_urb(usbhid->urbctrl);
        usb_kill_urb(usbhid->urbout);