From: zhong jiang <zhongjiang@huawei.com>
To: <davem@davemloft.net>, <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] wireless: remove unnecessary condition check before kfree
Date: Sat, 8 Sep 2018 22:12:35 +0800 [thread overview]
Message-ID: <1536415955-33776-1-git-send-email-zhongjiang@huawei.com> (raw)
kfree has taken the null pointer into account. Just remove the
redundant condition check before kfree.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
net/wireless/reg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5ad5b9f..dc87e3d 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1086,7 +1086,7 @@ int reg_reload_regdb(void)
}
rtnl_lock();
- if (!IS_ERR_OR_NULL(regdb))
+ if (!IS_ERR(regdb))
kfree(regdb);
regdb = db;
rtnl_unlock();
@@ -3920,7 +3920,7 @@ void regulatory_exit(void)
kfree(reg_request);
}
- if (!IS_ERR_OR_NULL(regdb))
+ if (!IS_ERR(regdb))
kfree(regdb);
free_regdb_keyring();
--
1.7.12.4
next reply other threads:[~2018-09-08 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-08 14:12 zhong jiang [this message]
2018-09-10 7:10 ` Johannes Berg
2018-09-10 13:54 ` zhong jiang
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=1536415955-33776-1-git-send-email-zhongjiang@huawei.com \
--to=zhongjiang@huawei.com \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®