Browse Source

IB/mthca: NULL arg to pci_dev_put is OK

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 <elfring@users.sourceforge.net>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Markus Elfring 9 years ago
parent
commit
3491ab63b4
1 changed files with 1 additions and 2 deletions
  1. 1 2
      drivers/infiniband/hw/mthca/mthca_reset.c

+ 1 - 2
drivers/infiniband/hw/mthca/mthca_reset.c

@@ -279,8 +279,7 @@ good:
 	}
 
 out:
-	if (bridge)
-		pci_dev_put(bridge);
+	pci_dev_put(bridge);
 	kfree(bridge_header);
 	kfree(hca_header);