From: Heinrich Schuchardt Date: Wed, 8 Nov 2017 21:30:59 +0000 (+0100) Subject: ubi: no NULL check needed before kmem_cache_destroy X-Git-Tag: v2018.01-rc1~87^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd5f33e5fc832effd70866fccd629046a6dac265;p=platform%2Fkernel%2Fu-boot.git 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 --- diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 90fb74a..33c176a 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); }