Skip to content

Commit 6db1671

Browse files
elfringdavem330
authored andcommitted
net-PA Semi: Deletion of unnecessary checks before the function call "pci_dev_put"
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]> Acked-by: Olof Johansson <[email protected]> Acked-by: Luis R. Rodriguez <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 04901ce commit 6db1671

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/pasemi/pasemi_mac.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,10 +1837,8 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
18371837
return err;
18381838

18391839
out:
1840-
if (mac->iob_pdev)
1841-
pci_dev_put(mac->iob_pdev);
1842-
if (mac->dma_pdev)
1843-
pci_dev_put(mac->dma_pdev);
1840+
pci_dev_put(mac->iob_pdev);
1841+
pci_dev_put(mac->dma_pdev);
18441842

18451843
free_netdev(dev);
18461844
out_disable_device:

0 commit comments

Comments
 (0)