Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18a77b5d authored by Henry Gebhardt's avatar Henry Gebhardt Committed by Greg Kroah-Hartman
Browse files

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: default avatarHenry Gebhardt <gebhardt@astro.uni-tuebingen.de>
Acked-by: default avatarOliver Neukum <oliver@neukum.org>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a1f17a87
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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: