USB: CDC-ACM: fix poison/unpoison imbalance
authorOliver Neukum <oneukum@suse.com>
Wed, 21 Apr 2021 07:45:13 +0000 (09:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Apr 2021 11:41:51 +0000 (13:41 +0200)
commit469633d344ba25e37b317dcf687f306ebe0c2bd4
tree0b693aa8b19fa5efa3b87fa26d904ae7d17a2d04
parent0f000005da31f6947f843ce6b3e3a960540c6e00
USB: CDC-ACM: fix poison/unpoison imbalance

commit a8b3b519618f30a87a304c4e120267ce6f8dc68a 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: 6069e3e927c8f ("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>
drivers/usb/class/cdc-acm.c