diff options
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 37d2a95c5a45..79cf503e37bf 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -536,7 +536,8 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re | |||
536 | int head; | 536 | int head; |
537 | struct usbhid_device *usbhid = hid->driver_data; | 537 | struct usbhid_device *usbhid = hid->driver_data; |
538 | 538 | ||
539 | if ((hid->quirks & HID_QUIRK_NOGET) && dir == USB_DIR_IN) | 539 | if (((hid->quirks & HID_QUIRK_NOGET) && dir == USB_DIR_IN) || |
540 | test_bit(HID_DISCONNECTED, &usbhid->iofl)) | ||
540 | return; | 541 | return; |
541 | 542 | ||
542 | if (usbhid->urbout && dir == USB_DIR_OUT && report->type == HID_OUTPUT_REPORT) { | 543 | if (usbhid->urbout && dir == USB_DIR_OUT && report->type == HID_OUTPUT_REPORT) { |
@@ -1366,6 +1367,9 @@ static void usbhid_disconnect(struct usb_interface *intf) | |||
1366 | return; | 1367 | return; |
1367 | 1368 | ||
1368 | usbhid = hid->driver_data; | 1369 | usbhid = hid->driver_data; |
1370 | spin_lock_irq(&usbhid->lock); /* Sync with error and led handlers */ | ||
1371 | set_bit(HID_DISCONNECTED, &usbhid->iofl); | ||
1372 | spin_unlock_irq(&usbhid->lock); | ||
1369 | hid_destroy_device(hid); | 1373 | hid_destroy_device(hid); |
1370 | kfree(usbhid); | 1374 | kfree(usbhid); |
1371 | } | 1375 | } |