aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/ldusb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index ad4fb15b5dcb..90f130126c10 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -412,6 +412,9 @@ static unsigned int ld_usb_poll(struct file *file, poll_table *wait)
412 412
413 dev = file->private_data; 413 dev = file->private_data;
414 414
415 if (!dev->intf)
416 return POLLERR | POLLHUP;
417
415 poll_wait(file, &dev->read_wait, wait); 418 poll_wait(file, &dev->read_wait, wait);
416 poll_wait(file, &dev->write_wait, wait); 419 poll_wait(file, &dev->write_wait, wait);
417 420
@@ -767,6 +770,9 @@ static void ld_usb_disconnect(struct usb_interface *intf)
767 ld_usb_delete(dev); 770 ld_usb_delete(dev);
768 } else { 771 } else {
769 dev->intf = NULL; 772 dev->intf = NULL;
773 /* wake up pollers */
774 wake_up_interruptible_all(&dev->read_wait);
775 wake_up_interruptible_all(&dev->write_wait);
770 mutex_unlock(&dev->mutex); 776 mutex_unlock(&dev->mutex);
771 } 777 }
772 778