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>
This commit is contained in:
Markus Elfring 2016-07-23 10:05:12 +02:00 committed by Doug Ledford
parent f7ca535ba0
commit 3491ab63b4
1 changed files with 1 additions and 2 deletions

View File

@ -279,8 +279,7 @@ int mthca_reset(struct mthca_dev *mdev)
}
out:
if (bridge)
pci_dev_put(bridge);
pci_dev_put(bridge);
kfree(bridge_header);
kfree(hca_header);