Skip to content

Commit

Permalink
ata: Delete unnecessary checks before the function call "pci_dev_put"
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
elfring authored and htejun committed Feb 3, 2015
1 parent 1726390 commit 214f1af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/ata/pata_cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,8 @@ static int cs5530_init_chip(void)
pci_dev_put(cs5530_0);
return 0;
fail_put:
if (master_0)
pci_dev_put(master_0);
if (cs5530_0)
pci_dev_put(cs5530_0);
pci_dev_put(master_0);
pci_dev_put(cs5530_0);
return -ENODEV;
}

Expand Down

0 comments on commit 214f1af

Please sign in to comment.