From: Bjørn Mork Date: Fri, 29 Nov 2013 19:17:45 +0000 (+0100) Subject: usb: cdc-wdm: manage_power should always set needs_remote_wakeup X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=f62f6338d12d86133ea925822a3a95821a74ae58;p=linux-edison.git usb: cdc-wdm: manage_power should always set needs_remote_wakeup commit 4144bc861ed7934d56f16d2acd808d44af0fcc90 upstream. Reported-by: Oliver Neukum Signed-off-by: Bjørn Mork Acked-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index d3318a0df8e..6463ca3bcfb 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -820,13 +820,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)