From: Markus Elfring Date: Sat, 23 Jul 2016 08:05:12 +0000 (+0200) Subject: IB/mthca: NULL arg to pci_dev_put is OK X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3491ab63b45ea9b485683574081ed8535d42f2da;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Leon Romanovsky Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c index 74c6a9426047..c5216542477c 100644 --- a/drivers/infiniband/hw/mthca/mthca_reset.c +++ b/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);