Commit 72601945 authored by Markus Elfring's avatar Markus Elfring Committed by Borislav Petkov

EDAC: Delete unnecessary checks before pci_dev_put()

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Link: http://lkml.kernel.org/r/54CFC12C.9010002@users.sourceforge.netSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
parent c517d838
...@@ -445,9 +445,7 @@ static int __init i82443bxgx_edacmc_init(void) ...@@ -445,9 +445,7 @@ static int __init i82443bxgx_edacmc_init(void)
pci_unregister_driver(&i82443bxgx_edacmc_driver); pci_unregister_driver(&i82443bxgx_edacmc_driver);
fail0: fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev); pci_dev_put(mci_pdev);
return pci_rc; return pci_rc;
} }
......
...@@ -343,19 +343,14 @@ static int __init i82860_init(void) ...@@ -343,19 +343,14 @@ static int __init i82860_init(void)
pci_unregister_driver(&i82860_driver); pci_unregister_driver(&i82860_driver);
fail0: fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev); pci_dev_put(mci_pdev);
return pci_rc; return pci_rc;
} }
static void __exit i82860_exit(void) static void __exit i82860_exit(void)
{ {
edac_dbg(3, "\n"); edac_dbg(3, "\n");
pci_unregister_driver(&i82860_driver); pci_unregister_driver(&i82860_driver);
if (mci_pdev != NULL)
pci_dev_put(mci_pdev); pci_dev_put(mci_pdev);
} }
......
...@@ -576,9 +576,7 @@ static int __init i82875p_init(void) ...@@ -576,9 +576,7 @@ static int __init i82875p_init(void)
pci_unregister_driver(&i82875p_driver); pci_unregister_driver(&i82875p_driver);
fail0: fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev); pci_dev_put(mci_pdev);
return pci_rc; return pci_rc;
} }
......
...@@ -685,9 +685,7 @@ static int __init i82975x_init(void) ...@@ -685,9 +685,7 @@ static int __init i82975x_init(void)
pci_unregister_driver(&i82975x_driver); pci_unregister_driver(&i82975x_driver);
fail0: fail0:
if (mci_pdev != NULL)
pci_dev_put(mci_pdev); pci_dev_put(mci_pdev);
return pci_rc; return pci_rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment