Skip to contentSkip to conversation

fs/xfs: Remove NULL check before kmem_cache_destroy

PATCH In review Tim Hansen 2 participants 3 messages Nov 8, 2017 XFS filesystem

lore
Share & tools
lore

Tim Hansen

author
#0 lore raw

PATCH 1/1 fs/xfs: Remove NULL check before kmem_cache_destroy

kmem_cache_destroy already checks for null values.

---
 fs/xfs/kmem.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/kmem.h +1 -2
index 7509019..4b87472 100644
@@ -119,8 +119,7 @@ kmem_zone_free(kmem_zone_t *zone, void *ptr)
 static inline void
 kmem_zone_destroy(kmem_zone_t *zone)
 {
-	if (zone)
-		kmem_cache_destroy(zone);
+	kmem_cache_destroy(zone);
 }
 
 extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t);
Signature · 1 line
2.1.4
author
#1 lore raw
Quoted 24 lines · Tim Hansen

kmem_cache_destroy already checks for null values.

---
 fs/xfs/kmem.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/kmem.h +1 -2
index 7509019..4b87472 100644
@@ -119,8 +119,7 @@ kmem_zone_free(kmem_zone_t *zone, void *ptr)
 static inline void
 kmem_zone_destroy(kmem_zone_t *zone)
 {
-	if (zone)
-		kmem_cache_destroy(zone);
+	kmem_cache_destroy(zone);
 }
 
 extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t);
Signature · 1 line
2.1.4

This patch was created on linux-next repo, tag next-20171108.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Tim Hansen
Quoted 3 lines · Tim Hansen

kmem_cache_destroy already checks for null values.

Looks ok,

Quoted 25 lines
---
 fs/xfs/kmem.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/kmem.h +1 -2
index 7509019..4b87472 100644
@@ -119,8 +119,7 @@ kmem_zone_free(kmem_zone_t *zone, void *ptr)
 static inline void
 kmem_zone_destroy(kmem_zone_t *zone)
 {
-	if (zone)
-		kmem_cache_destroy(zone);
+	kmem_cache_destroy(zone);
 }
 
 extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t);
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html