mtd: delete unnecessary checks before two function calls

The functions kfree() and pci_dev_put() test whether their argument is NULL
and then return immediately. 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>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
Markus Elfring 2014-11-20 13:50:43 +01:00 committed by Brian Norris
parent 775a9134f4
commit 05a221bb1f
2 changed files with 2 additions and 4 deletions

View File

@ -2654,7 +2654,6 @@ static void cfi_intelext_destroy(struct mtd_info *mtd)
kfree(cfi);
for (i = 0; i < mtd->numeraseregions; i++) {
region = &mtd->eraseregions[i];
if (region->lockmap)
kfree(region->lockmap);
}
kfree(mtd->eraseregions);

View File

@ -812,7 +812,6 @@ static int __init init_pmc551(void)
}
/* Exited early, reference left over */
if (PCI_Device)
pci_dev_put(PCI_Device);
if (!pmc551list) {