IB/mthca: NULL arg to pci_dev_put is OK
authorMarkus Elfring <[email protected]>
Sat, 23 Jul 2016 08:05:12 +0000 (10:05 +0200)
committerDoug Ledford <[email protected]>
Thu, 4 Aug 2016 01:03:35 +0000 (21:03 -0400)
The pci_dev_put() 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 <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
drivers/infiniband/hw/mthca/mthca_reset.c

index 74c6a9426047b8a34a419cddd39294b294d2fe38..c5216542477c7525caac5bea2775699d120067fe 100644 (file)
@@ -279,8 +279,7 @@ good:
        }
 
 out:
-       if (bridge)
-               pci_dev_put(bridge);
+       pci_dev_put(bridge);
        kfree(bridge_header);
        kfree(hca_header);