Skip to content

Commit

Permalink
EDAC: Delete unnecessary checks before 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 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]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Borislav Petkov <[email protected]>
  • Loading branch information
elfring authored and suryasaimadhu committed Feb 23, 2015
1 parent c517d83 commit 7260194
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
4 changes: 1 addition & 3 deletions drivers/edac/i82443bxgx_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,7 @@ static int __init i82443bxgx_edacmc_init(void)
pci_unregister_driver(&i82443bxgx_edacmc_driver);

fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev);

pci_dev_put(mci_pdev);
return pci_rc;
}

Expand Down
9 changes: 2 additions & 7 deletions drivers/edac/i82860_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,20 +343,15 @@ static int __init i82860_init(void)
pci_unregister_driver(&i82860_driver);

fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev);

pci_dev_put(mci_pdev);
return pci_rc;
}

static void __exit i82860_exit(void)
{
edac_dbg(3, "\n");

pci_unregister_driver(&i82860_driver);

if (mci_pdev != NULL)
pci_dev_put(mci_pdev);
pci_dev_put(mci_pdev);
}

module_init(i82860_init);
Expand Down
4 changes: 1 addition & 3 deletions drivers/edac/i82875p_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,7 @@ static int __init i82875p_init(void)
pci_unregister_driver(&i82875p_driver);

fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev);

pci_dev_put(mci_pdev);
return pci_rc;
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/edac/i82975x_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,7 @@ static int __init i82975x_init(void)
pci_unregister_driver(&i82975x_driver);

fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev);

pci_dev_put(mci_pdev);
return pci_rc;
}

Expand Down

0 comments on commit 7260194

Please sign in to comment.