summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorJulia Lawall2015-09-13 14:14:54 +0200
committerBrian Norris2015-09-22 02:04:50 +0200
commit0791a5f8ab5082d2726d99f3b21036d438c11424 (patch)
treedcc27179658e39891af622d09bb8fcab568ff6e6 /drivers/mtd/nand
parentmtd: spi-nor: remove unused read_xfer/write_xfer hooks (diff)
downloadkernel-qcow2-linux-0791a5f8ab5082d2726d99f3b21036d438c11424.tar.gz
kernel-qcow2-linux-0791a5f8ab5082d2726d99f3b21036d438c11424.tar.xz
kernel-qcow2-linux-0791a5f8ab5082d2726d99f3b21036d438c11424.zip
mtd: nandsim: drop null test before destroy functions
Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/nandsim.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 95d0cc49cfc2..b16d70aafd9e 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -649,8 +649,7 @@ static void free_device(struct nandsim *ns)
kmem_cache_free(ns->nand_pages_slab,
ns->pages[i].byte);
}
- if (ns->nand_pages_slab)
- kmem_cache_destroy(ns->nand_pages_slab);
+ kmem_cache_destroy(ns->nand_pages_slab);
vfree(ns->pages);
}
}