USB-SIS: Deletion of an unnecessary check before the function call "usb_put_dev"
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 21 Nov 2014 14:50:44 +0000 (15:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Nov 2014 01:24:31 +0000 (17:24 -0800)
The usb_put_dev() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/sisusbvga/sisusb.c

index 633caf64312232bb7e73954357f1efb66313597a..022dc0008f2a6ac993f931e0c29478a61288cb68 100644 (file)
@@ -2472,8 +2472,7 @@ sisusb_delete(struct kref *kref)
        if (!sisusb)
                return;
 
-       if (sisusb->sisusb_dev)
-               usb_put_dev(sisusb->sisusb_dev);
+       usb_put_dev(sisusb->sisusb_dev);
 
        sisusb->sisusb_dev = NULL;
        sisusb_free_buffers(sisusb);