提交 f38649fe 编写于 作者: O Oliver Neukum 提交者: 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: NOliver Neukum <oliver@neukum.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 6f23ee1f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册