Re: [U-Boot] [PATCH 1/1] ubi: no NULL check needed before kmem_cache_destroy

2017-11-20 Thread Heiko Schocher

Hello Heinrich,

Am 08.11.2017 um 22:30 schrieb Heinrich Schuchardt:

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(-)


applied to u-boot-ubi master

Thanks!

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/1] ubi: no NULL check needed before kmem_cache_destroy

2017-11-08 Thread Heinrich Schuchardt
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(-)

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