Skip to content

Commit

Permalink
net-PA Semi: Deletion of unnecessary checks before the function call …
Browse files Browse the repository at this point in the history
…"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]>
  • Loading branch information
elfring authored and davem330 committed Dec 6, 2014
1 parent 04901ce commit 6db1671
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/pasemi/pasemi_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1837,10 +1837,8 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return err;

out:
if (mac->iob_pdev)
pci_dev_put(mac->iob_pdev);
if (mac->dma_pdev)
pci_dev_put(mac->dma_pdev);
pci_dev_put(mac->iob_pdev);
pci_dev_put(mac->dma_pdev);

free_netdev(dev);
out_disable_device:
Expand Down

0 comments on commit 6db1671

Please sign in to comment.