kmem_cache_destroy calls free which checks for NULL. Problem was indicated by coccinelle.
Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de> --- drivers/mtd/ubi/attach.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); } -- 2.14.2 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot