]> git.sur5r.net Git - u-boot/commitdiff
ubi: no NULL check needed before kmem_cache_destroy
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 8 Nov 2017 21:30:59 +0000 (22:30 +0100)
committerHeiko Schocher <hs@denx.de>
Mon, 20 Nov 2017 09:13:42 +0000 (10:13 +0100)
kmem_cache_destroy calls free which checks for NULL.

Problem was indicated by coccinelle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/mtd/ubi/attach.c

index 90fb74a5c966baeadf01e69c5ca6da9bb88d7e0f..33c176a77bdcb30ffea9c341da93c4a73885b1ec 100644 (file)
@@ -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);
 }