Commit f38649fe authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

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: default avatarOliver Neukum <oliver@neukum.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6f23ee1f
...@@ -565,11 +565,15 @@ static void mdc800_usb_disconnect (struct usb_interface *intf) ...@@ -565,11 +565,15 @@ static void mdc800_usb_disconnect (struct usb_interface *intf)
usb_deregister_dev(intf, &mdc800_class); 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; mdc800->state=NOT_CONNECTED;
usb_kill_urb(mdc800->irq_urb); usb_kill_urb(mdc800->irq_urb);
usb_kill_urb(mdc800->write_urb); usb_kill_urb(mdc800->write_urb);
usb_kill_urb(mdc800->download_urb); usb_kill_urb(mdc800->download_urb);
mutex_unlock(&mdc800->io_lock);
mdc800->dev = NULL; mdc800->dev = NULL;
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment