diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2014-11-19 10:00:13 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2014-11-19 10:33:48 -0500 |
commit | 0a98babd85b2e69d64ef6f2f8a5d029ddaa702e1 (patch) | |
tree | ac47547d6f75491f4cd75e9f0d2e1f27482bd937 /drivers/edac | |
parent | 19ca5a3cc425cc9a8abedb0f4fb7b4e7ceee2255 (diff) |
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>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i3000_edac.c | 3 | ||||
-rw-r--r-- | drivers/edac/i3200_edac.c | 3 | ||||
-rw-r--r-- | drivers/edac/i82443bxgx_edac.c | 3 | ||||
-rw-r--r-- | drivers/edac/x38_edac.c | 3 |
4 files changed, 4 insertions, 8 deletions
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c index cd28b968e5c7..5cb36a6022cc 100644 --- a/drivers/edac/i3000_edac.c +++ b/drivers/edac/i3000_edac.c | |||
@@ -542,8 +542,7 @@ fail1: | |||
542 | pci_unregister_driver(&i3000_driver); | 542 | pci_unregister_driver(&i3000_driver); |
543 | 543 | ||
544 | fail0: | 544 | fail0: |
545 | if (mci_pdev) | 545 | pci_dev_put(mci_pdev); |
546 | pci_dev_put(mci_pdev); | ||
547 | 546 | ||
548 | return pci_rc; | 547 | return pci_rc; |
549 | } | 548 | } |
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c index 022a70273ada..d1ff0ea2d3f3 100644 --- a/drivers/edac/i3200_edac.c +++ b/drivers/edac/i3200_edac.c | |||
@@ -523,8 +523,7 @@ fail1: | |||
523 | pci_unregister_driver(&i3200_driver); | 523 | pci_unregister_driver(&i3200_driver); |
524 | 524 | ||
525 | fail0: | 525 | fail0: |
526 | if (mci_pdev) | 526 | pci_dev_put(mci_pdev); |
527 | pci_dev_put(mci_pdev); | ||
528 | 527 | ||
529 | return pci_rc; | 528 | return pci_rc; |
530 | } | 529 | } |
diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c index d730e276d1a8..b4705d9366bf 100644 --- a/drivers/edac/i82443bxgx_edac.c +++ b/drivers/edac/i82443bxgx_edac.c | |||
@@ -458,8 +458,7 @@ static void __exit i82443bxgx_edacmc_exit(void) | |||
458 | if (!i82443bxgx_registered) | 458 | if (!i82443bxgx_registered) |
459 | i82443bxgx_edacmc_remove_one(mci_pdev); | 459 | i82443bxgx_edacmc_remove_one(mci_pdev); |
460 | 460 | ||
461 | if (mci_pdev) | 461 | pci_dev_put(mci_pdev); |
462 | pci_dev_put(mci_pdev); | ||
463 | } | 462 | } |
464 | 463 | ||
465 | module_init(i82443bxgx_edacmc_init); | 464 | module_init(i82443bxgx_edacmc_init); |
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c index e644b52c287c..7c5cdc62f31c 100644 --- a/drivers/edac/x38_edac.c +++ b/drivers/edac/x38_edac.c | |||
@@ -500,8 +500,7 @@ fail1: | |||
500 | pci_unregister_driver(&x38_driver); | 500 | pci_unregister_driver(&x38_driver); |
501 | 501 | ||
502 | fail0: | 502 | fail0: |
503 | if (mci_pdev) | 503 | pci_dev_put(mci_pdev); |
504 | pci_dev_put(mci_pdev); | ||
505 | 504 | ||
506 | return pci_rc; | 505 | return pci_rc; |
507 | } | 506 | } |