[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1533054298-35824-1-git-send-email-zhongjiang@huawei.com>
Date: Wed, 1 Aug 2018 00:24:58 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <tglx@...utronix.de>, <longman@...hat.com>
CC: <arnd@...db.de>, <yang.shi@...ux.alibaba.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] lib/debugobjects: remove redundant check when free the object
kmem_cache_destroy has taken the null check into account. so just
remove the unnecessary check.
Signed-off-by: zhong jiang <zhongjiang@...wei.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
Powered by blists - more mailing lists