From: tip-bot for Zhong Jiang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: yang.shi@linux.alibaba.com, zhongjiang@huawei.com, arnd@arndb.de,
mingo@kernel.org, longman@redhat.com, hpa@zytor.com,
tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: [tip:core/debugobjects] debugobjects: Remove redundant NULL pointer check
Date: Thu, 2 Aug 2018 04:57:55 -0700 [thread overview]
Message-ID: <tip-3ff4f80a74fd38398ae1bd8a458ba9c51aa0dd44@git.kernel.org> (raw)
In-Reply-To: <1533054298-35824-1-git-send-email-zhongjiang@huawei.com>
Commit-ID: 3ff4f80a74fd38398ae1bd8a458ba9c51aa0dd44
Gitweb: https://git.kernel.org/tip/3ff4f80a74fd38398ae1bd8a458ba9c51aa0dd44
Author: Zhong Jiang <zhongjiang@huawei.com>
AuthorDate: Wed, 1 Aug 2018 00:24:58 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 2 Aug 2018 13:53:04 +0200
debugobjects: Remove redundant NULL pointer check
kmem_cache_destroy() has a built in NULL pointer check, so the one at the
call can be removed.
Signed-off-by: Zhong Jiang <zhongjiang@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: <longman@redhat.com>
Cc: <arnd@arndb.de>
Cc: <yang.shi@linux.alibaba.com>
Link: https://lkml.kernel.org/r/1533054298-35824-1-git-send-email-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 24c1df0d7466..70935ed91125 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -1188,8 +1188,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();
prev parent reply other threads:[~2018-08-02 11:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-31 16:24 [PATCH] lib/debugobjects: remove redundant check when free the object zhong jiang
2018-08-02 11:57 ` tip-bot for Zhong Jiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-3ff4f80a74fd38398ae1bd8a458ba9c51aa0dd44@git.kernel.org \
--to=tipbot@zytor.com \
--cc=arnd@arndb.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=yang.shi@linux.alibaba.com \
--cc=zhongjiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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