From: Henry Gebhardt Date: Wed, 4 Nov 2009 10:19:28 +0000 (+0100) Subject: USB: cdc_acm: Fix race condition when opening tty X-Git-Tag: v2.6.32-rc8~12^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18a77b5d237a67d2c621a46f5271a3b51da1b380;p=profile%2Fcommon%2Fkernel-common.git USB: cdc_acm: Fix race condition when opening tty If acm_rx_tasklet() gets called before tty_port_block_til_ready() returns, then bulk IN urbs may not be sent. This fixes it. Signed-off-by: Henry Gebhardt Acked-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index e3861b2..b72fa49 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -609,9 +609,9 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) acm->throttle = 0; - tasklet_schedule(&acm->urb_task); set_bit(ASYNCB_INITIALIZED, &acm->port.flags); rv = tty_port_block_til_ready(&acm->port, tty, filp); + tasklet_schedule(&acm->urb_task); done: mutex_unlock(&acm->mutex); err_out: