1
0
Fork 0

EDAC: Delete unnecessary check before calling pci_dev_put()

The pci_dev_put() function tests whether its argument is NULL and then
returns immediately. Thus the test before the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: http://lkml.kernel.org/r/546CB20D.4070808@users.sourceforge.net
[ Boris: commit message. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
This commit is contained in:
Markus Elfring 2014-11-19 16:00:13 +01:00 committed by Borislav Petkov
parent 19ca5a3cc4
commit 0a98babd85
4 changed files with 4 additions and 8 deletions

View file

@ -542,8 +542,7 @@ fail1:
pci_unregister_driver(&i3000_driver);
fail0:
if (mci_pdev)
pci_dev_put(mci_pdev);
pci_dev_put(mci_pdev);
return pci_rc;
}

View file

@ -523,8 +523,7 @@ fail1:
pci_unregister_driver(&i3200_driver);
fail0:
if (mci_pdev)
pci_dev_put(mci_pdev);
pci_dev_put(mci_pdev);
return pci_rc;
}

View file

@ -458,8 +458,7 @@ static void __exit i82443bxgx_edacmc_exit(void)
if (!i82443bxgx_registered)
i82443bxgx_edacmc_remove_one(mci_pdev);
if (mci_pdev)
pci_dev_put(mci_pdev);
pci_dev_put(mci_pdev);
}
module_init(i82443bxgx_edacmc_init);

View file

@ -500,8 +500,7 @@ fail1:
pci_unregister_driver(&x38_driver);
fail0:
if (mci_pdev)
pci_dev_put(mci_pdev);
pci_dev_put(mci_pdev);
return pci_rc;
}