summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2014-11-20 13:50:43 +0100
committerBrian Norris <computersforpeace@gmail.com>2014-11-26 07:44:10 +0100
commit05a221bb1f49e6eebc9a3858cb45506f403b3ab6 (patch)
treeaa85b86eb0cc5d7aca9e6da39394157d8491f87c /drivers/mtd/chips
parentmtd: nand: omap: Fix NAND enumeration on 3430 LDP (diff)
downloadlinux-05a221bb1f49e6eebc9a3858cb45506f403b3ab6.tar.xz
linux-05a221bb1f49e6eebc9a3858cb45506f403b3ab6.zip
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>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 3096f3ded3ad..286b97a304cf 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -2654,8 +2654,7 @@ 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(region->lockmap);
}
kfree(mtd->eraseregions);
}