Skip to content

Commit af7099b

Browse files
oneukumgregkh
authored andcommitted
USB: CDC-ACM: fix poison/unpoison imbalance
commit a8b3b51 upstream. suspend() does its poisoning conditionally, resume() does it unconditionally. On a device with combined interfaces this will balance, on a device with two interfaces the counter will go negative and resubmission will fail. Both actions need to be done conditionally. Fixes: 6069e3e ("USB: cdc-acm: untangle a circular dependency between callback and softint") Signed-off-by: Oliver Neukum <oneukum@suse.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210421074513.4327-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d7fad2c commit af7099b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/usb/class/cdc-acm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1650,12 +1650,13 @@ static int acm_resume(struct usb_interface *intf)
16501650
struct urb *urb;
16511651
int rv = 0;
16521652

1653-
acm_unpoison_urbs(acm);
16541653
spin_lock_irq(&acm->write_lock);
16551654

16561655
if (--acm->susp_count)
16571656
goto out;
16581657

1658+
acm_unpoison_urbs(acm);
1659+
16591660
if (tty_port_initialized(&acm->port)) {
16601661
rv = usb_submit_urb(acm->ctrlurb, GFP_ATOMIC);
16611662

0 commit comments

Comments
 (0)