Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Markus Elfring and committed by
Borislav Petkov
72601945 c517d838

+5 -16
+1 -3
drivers/edac/i82443bxgx_edac.c
··· 445 445 pci_unregister_driver(&i82443bxgx_edacmc_driver); 446 446 447 447 fail0: 448 - if (mci_pdev != NULL) 449 - pci_dev_put(mci_pdev); 450 - 448 + pci_dev_put(mci_pdev); 451 449 return pci_rc; 452 450 } 453 451
+2 -7
drivers/edac/i82860_edac.c
··· 343 343 pci_unregister_driver(&i82860_driver); 344 344 345 345 fail0: 346 - if (mci_pdev != NULL) 347 - pci_dev_put(mci_pdev); 348 - 346 + pci_dev_put(mci_pdev); 349 347 return pci_rc; 350 348 } 351 349 352 350 static void __exit i82860_exit(void) 353 351 { 354 352 edac_dbg(3, "\n"); 355 - 356 353 pci_unregister_driver(&i82860_driver); 357 - 358 - if (mci_pdev != NULL) 359 - pci_dev_put(mci_pdev); 354 + pci_dev_put(mci_pdev); 360 355 } 361 356 362 357 module_init(i82860_init);
+1 -3
drivers/edac/i82875p_edac.c
··· 576 576 pci_unregister_driver(&i82875p_driver); 577 577 578 578 fail0: 579 - if (mci_pdev != NULL) 580 - pci_dev_put(mci_pdev); 581 - 579 + pci_dev_put(mci_pdev); 582 580 return pci_rc; 583 581 } 584 582
+1 -3
drivers/edac/i82975x_edac.c
··· 685 685 pci_unregister_driver(&i82975x_driver); 686 686 687 687 fail0: 688 - if (mci_pdev != NULL) 689 - pci_dev_put(mci_pdev); 690 - 688 + pci_dev_put(mci_pdev); 691 689 return pci_rc; 692 690 } 693 691