diff options
author | Oliver Neukum <oliver@neukum.org> | 2007-01-05 17:42:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-08 00:44:34 +0100 |
commit | f38649fee955c19f4df9b9e7267f87702712d973 (patch) | |
tree | 0d399a5ed6e8fb8a799d66c5849a23cc002986fe /drivers/usb/image | |
parent | USB: add binary API to usbmon (diff) | |
download | linux-f38649fee955c19f4df9b9e7267f87702712d973.tar.xz linux-f38649fee955c19f4df9b9e7267f87702712d973.zip |
USB: race on disconnect in mdc800
I overlooked one. Setting the flag and killing the URBs must be under the lock
so that no URB is submitted after usb_kill_urb()
Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/image')
-rw-r--r-- | drivers/usb/image/mdc800.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index 63a84bbc310d..d308afd06935 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -565,11 +565,15 @@ static void mdc800_usb_disconnect (struct usb_interface *intf) usb_deregister_dev(intf, &mdc800_class); + /* must be under lock to make sure no URB + is submitted after usb_kill_urb() */ + mutex_lock(&mdc800->io_lock); mdc800->state=NOT_CONNECTED; usb_kill_urb(mdc800->irq_urb); usb_kill_urb(mdc800->write_urb); usb_kill_urb(mdc800->download_urb); + mutex_unlock(&mdc800->io_lock); mdc800->dev = NULL; usb_set_intfdata(intf, NULL); |