提交 05a221bb 编写于 作者: M Markus Elfring 提交者: Brian Norris

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: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 775a9134
...@@ -2654,7 +2654,6 @@ static void cfi_intelext_destroy(struct mtd_info *mtd) ...@@ -2654,7 +2654,6 @@ static void cfi_intelext_destroy(struct mtd_info *mtd)
kfree(cfi); kfree(cfi);
for (i = 0; i < mtd->numeraseregions; i++) { for (i = 0; i < mtd->numeraseregions; i++) {
region = &mtd->eraseregions[i]; region = &mtd->eraseregions[i];
if (region->lockmap)
kfree(region->lockmap); kfree(region->lockmap);
} }
kfree(mtd->eraseregions); kfree(mtd->eraseregions);
......
...@@ -812,7 +812,6 @@ static int __init init_pmc551(void) ...@@ -812,7 +812,6 @@ static int __init init_pmc551(void)
} }
/* Exited early, reference left over */ /* Exited early, reference left over */
if (PCI_Device)
pci_dev_put(PCI_Device); pci_dev_put(PCI_Device);
if (!pmc551list) { if (!pmc551list) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册