Skip to contentSkip to conversation

dlm: remove unnecessary condition check

PATCH New Chengguang Xu 1 participant 1 message Nov 1, 2018 Distributed lock manager (DLM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dlm: remove unnecessary condition check

kmem_cache_destroy() can handle NULL pointer correctly, so there is no need to check NULL pointer before calling kmem_cache_destroy().

---
 fs/dlm/memory.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/dlm/memory.c +2 -4
index 7cd24bccd4fe..0349c89ae568 100644
@@ -38,10 +38,8 @@ int __init dlm_memory_init(void)
 
 void dlm_memory_exit(void)
 {
-	if (lkb_cache)
-		kmem_cache_destroy(lkb_cache);
-	if (rsb_cache)
-		kmem_cache_destroy(rsb_cache);
+	kmem_cache_destroy(lkb_cache);
+	kmem_cache_destroy(rsb_cache);
 }
 
 char *dlm_allocate_lvb(struct dlm_ls *ls)
Signature · 1 line
2.17.2