aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2013-11-29 20:17:45 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-08 09:42:10 -0800
commitbc8a3912facbd66e2b88d10922aae74548b86606 (patch)
tree5d5d16a1eb3a88d626ffd33d7d67839d61b8e718
parentb86d86822526d0be85d41cca71242fba6ac3c2c7 (diff)
downloadlinux-linaro-stable-bc8a3912facbd66e2b88d10922aae74548b86606.tar.gz
usb: cdc-wdm: manage_power should always set needs_remote_wakeup
commit 4144bc861ed7934d56f16d2acd808d44af0fcc90 upstream. Reported-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Bjørn Mork <bjorn@mork.no> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/class/cdc-wdm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 1434ee9ecb31..e5fa34e5423f 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -822,13 +822,11 @@ static int wdm_manage_power(struct usb_interface *intf, int on)
{
/* need autopm_get/put here to ensure the usbcore sees the new value */
int rv = usb_autopm_get_interface(intf);
- if (rv < 0)
- goto err;
intf->needs_remote_wakeup = on;
- usb_autopm_put_interface(intf);
-err:
- return rv;
+ if (!rv)
+ usb_autopm_put_interface(intf);
+ return 0;
}
static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)