USB: cdc-acm: fix double usb_autopm_put_interface() in acm_port_activate()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 11 Apr 2014 22:10:45 +0000 (02:10 +0400)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:03:17 +0000 (14:03 +0200)
commitf8dc9ab9dcf2133919763e00ba646fca891f248b
treeb9af1df9a241ea4e817016553e7c2e3ef3546b74
parent7b1a80c8b132b2bebe9193d2a9325d1c20fe4063
USB: cdc-acm: fix double usb_autopm_put_interface() in acm_port_activate()

commit 070c0b17f6a1ba39dff9be112218127e7e8fd456 upstream.

If acm_submit_read_urbs() fails in acm_port_activate(), error handling
code calls usb_autopm_put_interface() while it is already called
before acm_submit_read_urbs(). The patch reorganizes error handling code
to avoid double decrement of USB interface's PM-usage counter.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/usb/class/cdc-acm.c