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>
Tue, 27 May 2014 22:04:09 +0000 (15:04 -0700)
commit183a45087d126d126e8dd1d9b2602fc129dff9ad
tree39076939fe47eeeaf46f211c484ef843014d8e54
parented797074031a37bb9bf4a70952fffc606b77274d
USB: cdc-acm: fix potential urb leak and PM imbalance in write

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")

Cc: <stable@vger.kernel.org> # v2.6.27
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c