mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] lib/debugobjects: remove redundant check when free the object
@ 2018-07-31 16:24 zhong jiang
  2018-08-02 11:57 ` [tip:core/debugobjects] debugobjects: Remove redundant NULL pointer check tip-bot for Zhong Jiang
  0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-07-31 16:24 UTC (permalink / raw)
  To: tglx, longman; +Cc: arnd, yang.shi, linux-kernel

kmem_cache_destroy has taken the null check into account. so just
remove the unnecessary check.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 lib/debugobjects.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 994be48..7a6d80b 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -1185,8 +1185,7 @@ void __init debug_objects_mem_init(void)
 
 	if (!obj_cache || debug_objects_replace_static_objects()) {
 		debug_objects_enabled = 0;
-		if (obj_cache)
-			kmem_cache_destroy(obj_cache);
+		kmem_cache_destroy(obj_cache);
 		pr_warn("out of memory.\n");
 	} else
 		debug_objects_selftest();
-- 
1.7.12.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-02 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 16:24 [PATCH] lib/debugobjects: remove redundant check when free the object zhong jiang
2018-08-02 11:57 ` [tip:core/debugobjects] debugobjects: Remove redundant NULL pointer check tip-bot for Zhong Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome