Skip to content

Commit

Permalink
USB: cdc_acm: Fix race condition when opening tty
Browse files Browse the repository at this point in the history
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 <gebhardt@astro.uni-tuebingen.de>
Acked-by: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Henry Gebhardt authored and Greg Kroah-Hartman committed Nov 18, 2009
1 parent a1f17a8 commit 18a77b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 18a77b5

Please sign in to comment.