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

[PATCH] USB: fix race between disconnect and write of acm driver

acm uses a workqueue to defer part of a write operation.
In case of disconnect this work must be waited for.
  - fix race between write and disconnect
Signed-off-by: default avatarOliver Neukum <oliver@neukum.name>
Signed-off-by: default avatarVojtech Pavlik <vojtech@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 1daf74ac
...@@ -691,6 +691,8 @@ static void acm_disconnect(struct usb_interface *intf) ...@@ -691,6 +691,8 @@ static void acm_disconnect(struct usb_interface *intf)
usb_unlink_urb(acm->readurb); usb_unlink_urb(acm->readurb);
usb_unlink_urb(acm->writeurb); usb_unlink_urb(acm->writeurb);
flush_scheduled_work(); /* wait for acm_softint */
kfree(acm->ctrlurb->transfer_buffer); kfree(acm->ctrlurb->transfer_buffer);
usb_driver_release_interface(&acm_driver, acm->data); usb_driver_release_interface(&acm_driver, acm->data);
......
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