Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05a221bb authored by Markus Elfring's avatar Markus Elfring Committed by Brian Norris
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 775a9134
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);
+1 −2
Original line number Diff line number Diff line
@@ -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) {