From cd5f33e5fc832effd70866fccd629046a6dac265 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 8 Nov 2017 22:30:59 +0100 Subject: ubi: no NULL check needed before kmem_cache_destroy kmem_cache_destroy calls free which checks for NULL. Problem was indicated by coccinelle. Signed-off-by: Heinrich Schuchardt --- drivers/mtd/ubi/attach.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/mtd/ubi') diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 90fb74a5c9..33c176a77b 100644 --- a/drivers/mtd/ubi/attach.c +++ b/drivers/mtd/ubi/attach.c @@ -1205,8 +1205,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); } -- cgit