usbip: usbip_host: cleanup do_rebind() return path
authorShuah Khan <skhan@linuxfoundation.org>
Thu, 2 May 2019 19:47:18 +0000 (13:47 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 May 2019 06:34:49 +0000 (08:34 +0200)
Cleanup do_rebind() return path and use common return path.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/stub_main.c

index bf8a5fe..2e4bfcc 100644 (file)
@@ -201,7 +201,7 @@ static DRIVER_ATTR_RW(match_busid);
 
 static int do_rebind(char *busid, struct bus_id_priv *busid_priv)
 {
-       int ret;
+       int ret = 0;
 
        /* device_attach() callers should hold parent lock for USB */
        if (busid_priv->udev->dev.parent)
@@ -209,11 +209,9 @@ static int do_rebind(char *busid, struct bus_id_priv *busid_priv)
        ret = device_attach(&busid_priv->udev->dev);
        if (busid_priv->udev->dev.parent)
                device_unlock(busid_priv->udev->dev.parent);
-       if (ret < 0) {
+       if (ret < 0)
                dev_err(&busid_priv->udev->dev, "rebind failed\n");
-               return ret;
-       }
-       return 0;
+       return ret;
 }
 
 static void stub_device_rebind(void)