]> Pileus Git - ~andy/linux/commitdiff
net: cdc_mbim: fixup error return value
authorBjørn Mork <bjorn@mork.no>
Fri, 1 Nov 2013 13:18:56 +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 347e6b92673534676ccc9ac6a8c8a88699699d50..c9f3281506af568e534a47789418b466a0a77adc 100644 (file)
@@ -369,15 +369,13 @@ error:
 
 static int cdc_mbim_suspend(struct usb_interface *intf, pm_message_t message)
 {
-       int ret = 0;
+       int ret = -ENODEV;
        struct usbnet *dev = usb_get_intfdata(intf);
        struct cdc_mbim_state *info = (void *)&dev->data;
        struct cdc_ncm_ctx *ctx = info->ctx;
 
-       if (ctx == NULL) {
-               ret = -1;
+       if (!ctx)
                goto error;
-       }
 
        /*
         * Both usbnet_suspend() and subdriver->suspend() MUST return 0