From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@kernel.org>
Cc: Maninder Singh <maninder1.s@samsung.com>,
lgirdwood@gmail.com, patches@opensource.wolfsonmicro.com,
linux-kernel@vger.kernel.org, pankaj.m@samsung.com
Subject: Re: [PATCH v2] regulator: wm831x-dcdc: Use pointer after NULL check
Date: Thu, 2 Jul 2015 12:19:50 +0100 [thread overview]
Message-ID: <20150702111950.GD16517@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20150702111456.GY11162@sirena.org.uk>
On Thu, Jul 02, 2015 at 12:14:56PM +0100, Mark Brown wrote:
> On Thu, Jul 02, 2015 at 11:18:49AM +0100, Charles Keepax wrote:
> > On Thu, Jul 02, 2015 at 01:27:09PM +0530, Maninder Singh wrote:
> > > pdata is used before NULL check, so it looks misleading.
>
> > The patch basically looks fine, but it feels a bit like needless
> > churn. The current code is perfectly correct and feels clear
> > enough to me.
>
> It's a bug - either the validation shouldn't be there or it needs to be
> before the use otherwise it does nothing.
ARRAY_SIZE being implemented with sizeof's means that no actual
dereference takes place. But if we have multiple people thinking
this looks buggy then I guess the code probably isn't clear
enough at the moment.
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
next prev parent reply other threads:[~2015-07-02 11:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-02 7:57 [PATCH v2] regulator: wm831x-dcdc: Use pointer after NULL check Maninder Singh
2015-07-02 10:18 ` Charles Keepax
2015-07-02 11:14 ` Mark Brown
2015-07-02 11:19 ` Charles Keepax [this message]
2015-07-02 11:33 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2015-07-02 11:02 Maninder Singh
2015-07-02 11:12 ` Charles Keepax
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=20150702111950.GD16517@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maninder1.s@samsung.com \
--cc=pankaj.m@samsung.com \
--cc=patches@opensource.wolfsonmicro.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).