net: cdc_mbim: manage_power should always set needs_remote_wakeup
authorBjørn Mork <bjorn@mork.no>
Fri, 1 Nov 2013 13:18:52 +0000 (14:18 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Nov 2013 20:40:16 +0000 (15:40 -0500)
Reported-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_mbim.c

index af76aaf08b6b9bf16682087a3e727ee0dafefa1e..fbfd67fe6a9a1d80cec2a9b46dfb13432f789a5b 100644 (file)
@@ -44,13 +44,11 @@ static int cdc_mbim_manage_power(struct usbnet *dev, int on)
        if ((on && atomic_add_return(1, &info->pmcount) == 1) || (!on && atomic_dec_and_test(&info->pmcount))) {
                /* need autopm_get/put here to ensure the usbcore sees the new value */
                rv = usb_autopm_get_interface(dev->intf);
-               if (rv < 0)
-                       goto err;
                dev->intf->needs_remote_wakeup = on;
-               usb_autopm_put_interface(dev->intf);
+               if (!rv)
+                       usb_autopm_put_interface(dev->intf);
        }
-err:
-       return rv;
+       return 0;
 }
 
 static int cdc_mbim_wdm_manage_power(struct usb_interface *intf, int status)