USB: cdc-acm: fix potential urb leak and PM imbalance in write
authorJohan Hovold <jhovold@gmail.com>
Mon, 26 May 2014 17:23:41 +0000 (19:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jun 2014 19:15:41 +0000 (15:15 -0400)
commitbb086f8a1da9a7c521cc36b2087a544290b17e94
tree47da7888c4189bac0814031921b7d251af2f2d66
parent7dfa070023fee95f181e0cd2bec1cb57417f41e2
USB: cdc-acm: fix potential urb leak and PM imbalance in write

commit 183a45087d126d126e8dd1d9b2602fc129dff9ad upstream.

Make sure to check return value of autopm get in write() in order to
avoid urb leak and PM counter imbalance on errors.

Fixes: 11ea859d64b6 ("USB: additional power savings for cdc-acm devices
that support remote wakeup")

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c