From: Johannes Berg <johannes@sipsolutions.net>
To: zhong jiang <zhongjiang@huawei.com>, davem@davemloft.net
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wireless: remove unnecessary condition check before kfree
Date: Mon, 10 Sep 2018 09:10:06 +0200 [thread overview]
Message-ID: <1536563406.3224.2.camel@sipsolutions.net> (raw)
In-Reply-To: <1536415955-33776-1-git-send-email-zhongjiang@huawei.com>
On Sat, 2018-09-08 at 22:12 +0800, zhong jiang wrote:
> kfree has taken the null pointer into account. Just remove the
> redundant condition check before kfree.
I'm all for doing that if it actually removes conditionals, but
> - if (!IS_ERR_OR_NULL(regdb))
> + if (!IS_ERR(regdb))
> kfree(regdb);
this seems rather pointless since there's still a condition. In that
case, I feel it's easier to understand the original code.
johannes
next prev parent reply other threads:[~2018-09-10 7:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-08 14:12 [PATCH] wireless: remove unnecessary condition check before kfree zhong jiang
2018-09-10 7:10 ` Johannes Berg [this message]
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=1536563406.3224.2.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).