From: Jonathan Cameron <jic23@kernel.org>
To: Himanshu Jha <himanshujha199640@gmail.com>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>,
linux-iio@vger.kernel.org, lars@metafoo.de, eraretuya@gmail.com,
dan.carpenter@oracle.com
Subject: Re: [PATCH] iio: adxl345: move null check for i2c id at start of probe
Date: Sun, 19 Aug 2018 18:31:32 +0100 [thread overview]
Message-ID: <20180819183132.4f785935@archlinux> (raw)
In-Reply-To: <20180811101833.GA5243@himanshu-Vostro-3559>
On Sat, 11 Aug 2018 15:48:33 +0530
Himanshu Jha <himanshujha199640@gmail.com> wrote:
> On Tue, Aug 07, 2018 at 05:06:05PM +0300, Alexandru Ardelean wrote:
> > Fixes ef89f4b96a2 ("iio: adxl345: Add support for the ADXL375").
> >
> > This was found via static checker.
> > After looking into the code a bit, it's unlikely that there will be a NULL
> > dereference if the `id` object in that specific code path.
> > However, it's safe to add a NULL (paranoid) check just to make sure and
> > remove any uncertainties.
>
> I would like to know when would that case happen actually ?
>
> Because probe will only be called only when a match occurs either
> through DT or id matching. Isn't it ?
>
Yes. Alternative would have just not been to check it, but this is fine
so applied. I'm not going to rush this through stable though given
I don't think it can actually happen.
Jonathan
next prev parent reply other threads:[~2018-08-19 20:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 14:06 [PATCH] iio: adxl345: move null check for i2c id at start of probe Alexandru Ardelean
2018-08-11 10:18 ` Himanshu Jha
2018-08-19 17:31 ` Jonathan Cameron [this message]
2018-08-19 17:43 ` Himanshu Jha
2018-08-19 17:59 ` Lars-Peter Clausen
2018-08-19 18:54 ` Himanshu Jha
2018-08-19 19:12 ` Jonathan Cameron
2018-08-20 8:45 ` Dan Carpenter
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=20180819183132.4f785935@archlinux \
--to=jic23@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=dan.carpenter@oracle.com \
--cc=eraretuya@gmail.com \
--cc=himanshujha199640@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).