EDAC: Delete unnecessary checks before pci_dev_put()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 2 Feb 2015 17:26:34 +0000 (18:26 +0100)
committerBorislav Petkov <bp@suse.de>
Mon, 23 Feb 2015 12:06:23 +0000 (13:06 +0100)
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 <elfring@users.sourceforge.net>
Link: http://lkml.kernel.org/r/54CFC12C.9010002@users.sourceforge.net
Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/i82443bxgx_edac.c
drivers/edac/i82860_edac.c
drivers/edac/i82875p_edac.c
drivers/edac/i82975x_edac.c

index b4705d9366bf33d3c6223aacf8f47b8461b25a59..38d6406943127750a44f4a9991365cfc02e53843 100644 (file)
@@ -445,9 +445,7 @@ fail1:
        pci_unregister_driver(&i82443bxgx_edacmc_driver);
 
 fail0:
-       if (mci_pdev != NULL)
-               pci_dev_put(mci_pdev);
-
+       pci_dev_put(mci_pdev);
        return pci_rc;
 }
 
index 4382343a7c60ed3cc4d5d1ea4f7661c62b1fe5bc..ee1078cd3b966a1b473ca76b164947177cd9fdbc 100644 (file)
@@ -343,20 +343,15 @@ fail1:
        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);
index 64b68320249f0e5e05db5ef8a0eccc0a2925dade..c26a513f88697bf690f34e66ada74ec091ac764d 100644 (file)
@@ -576,9 +576,7 @@ fail1:
        pci_unregister_driver(&i82875p_driver);
 
 fail0:
-       if (mci_pdev != NULL)
-               pci_dev_put(mci_pdev);
-
+       pci_dev_put(mci_pdev);
        return pci_rc;
 }
 
index 10b10521f62e19a550479755ad41247683d336e6..35ab66c623a3061e4ab03de7221b4852fbd59f63 100644 (file)
@@ -685,9 +685,7 @@ fail1:
        pci_unregister_driver(&i82975x_driver);
 
 fail0:
-       if (mci_pdev != NULL)
-               pci_dev_put(mci_pdev);
-
+       pci_dev_put(mci_pdev);
        return pci_rc;
 }