USB: fix bug in acm's open function
Subsystems (2)
PATCH 1/1 USB: fix bug in acm's open function
Here's a patch for 2.6.11-rc5 that a lot of cdc-acm driver users are clammering for.
There's a bug introduced in a cleanup which will lead
to a race making reopenings fail. This fix is by Alexander Lykanov.
Signed-off-by Oliver Neukum <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
drivers/usb/class/cdc-acm.c +4 -4
@@ -278,15 +278,14 @@ -if (acm->used) { +if (acm->used++) { goto done; } acm->ctrlurb->dev = acm->dev;if (usb_submit_urb (acm->ctrlurb,GFP_KERNEL )) {dbg ("usb_submit_urb(ctrl irq) failed" ); - rv = -EIO ; - goto err_out; + goto bail_out; } acm->readurb->dev = acm->dev;
@@ -303,7 +302,6 @@ tty->low_latency =1 ; done: - acm->used++; err_out:up (&open_sem);return rv;
@@ -312,6 +310,8 @@usb_kill_urb (acm->readurb); bail_out_and_unlink:usb_kill_urb (acm->ctrlurb); +bail_out: + acm->used--;up (&open_sem);return -EIO ; }