summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJulia Lawall <julia.lawall@lip6.fr>2015-09-13 14:15:16 +0200
committerRichard Weinberger <richard@nod.at>2015-10-03 20:36:10 +0200
commitf9a113d65fa56d8e8e662e37ec2fbeac0d52aa01 (patch)
treec5a5c13f348993062ce04bfc968306dcc355de3d /drivers
parentUBI: Update comments to reflect UBI_METAONLY flag (diff)
downloadlinux-f9a113d65fa56d8e8e662e37ec2fbeac0d52aa01.tar.xz
linux-f9a113d65fa56d8e8e662e37ec2fbeac0d52aa01.zip
UBI: 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: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/ubi/attach.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 68eea5befaf1..c1aaf0336cf2 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai)
}
}
- if (ai->aeb_slab_cache)
- kmem_cache_destroy(ai->aeb_slab_cache);
-
+ kmem_cache_destroy(ai->aeb_slab_cache);
kfree(ai);
}