public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Colin King <colin.king@canonical.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][V2] reset: remove redundant null check on pointer dev
Date: Fri, 10 May 2019 10:25:27 +0000	[thread overview]
Message-ID: <1557483927.7859.3.camel@pengutronix.de> (raw)
In-Reply-To: <CAMpxmJWyVZ2hHE=1tu5NgSzEHZKD2pBo8KUXg1CLUaB-WX4KHQ@mail.gmail.com>

On Fri, 2019-05-10 at 12:14 +0200, Bartosz Golaszewski wrote:
> pt., 10 maj 2019 o 11:58 Colin King <colin.king@canonical.com> napisał(a):
> > 
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > Pointer dev is being dereferenced when passed to the inlined
> > functon dev_name, however, dev is later being null checked
> > so at first this seems like a potential null pointer dereference.
> > 
> > In fact, _reset_control_get_from_lookup is only ever called from
> > __reset_control_get, right after checking dev->of_node hence
> > dev can never be null.  Clean this up by removing the redundant
> > null check.
> > 
> > Thanks to Philipp Zabel for spotting that dev can never be null.
> > 
> > Addresses-Coverity: ("Dereference before null check")
> > Fixes: 6691dffab0ab ("reset: add support for non-DT systems")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
[...]
> Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Thank you both, applied to reset/fixes.

regards
Philipp

      reply	other threads:[~2019-05-10 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10  9:58 [PATCH][V2] reset: remove redundant null check on pointer dev Colin King
2019-05-10 10:14 ` Bartosz Golaszewski
2019-05-10 10:25   ` Philipp Zabel [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=1557483927.7859.3.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=bgolaszewski@baylibre.com \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@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