linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Peter Huewe" <peterhuewe@gmx.de>,
	linux-integrity@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] char: tpm: cr50_i2c: Drop if with an always false condition
Date: Wed, 4 May 2022 07:02:44 +0300	[thread overview]
Message-ID: <YnH65MnQdkpZ10pe@kernel.org> (raw)
In-Reply-To: <20220426113541.GA64706@ziepe.ca>

On Tue, Apr 26, 2022 at 08:35:41AM -0300, Jason Gunthorpe wrote:
> On Tue, Apr 26, 2022 at 07:35:29AM +0300, Jarkko Sakkinen wrote:
> 
> > Even if chip is expected not to be NULL, a sanity check costs nothing.
> > As already said, this should be reviewed in the context of the callback
> > change.
> > 
> > Even then, the change should rather be:
> > 
> >        if (!chip) {
> >                dev_err(dev, "Could not get client data at remove\n");
> >                return;
> >        } 
> 
> If it can't happen by design it should be deleted entirely, or be
> turned into a WARN_ON:
> 
> if (WARN_ON(!chip))
>    return;
> 
> But I find this largely unnecessary as a null chip will reliably oops
> later on in the same function.
> 
> Jason

Fine, I applied the patch.

BR, Jarkko

      reply	other threads:[~2022-05-04  4:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 22:53 [PATCH] char: tpm: cr50_i2c: Drop if with an always false condition Uwe Kleine-König
2021-11-13 10:53 ` Jarkko Sakkinen
2021-11-13 21:53   ` Uwe Kleine-König
2021-11-16 15:55     ` Jarkko Sakkinen
2021-11-16 17:30       ` Uwe Kleine-König
2022-03-31 13:22         ` Uwe Kleine-König
2022-04-25 19:11           ` Uwe Kleine-König
2022-04-26  4:35             ` Jarkko Sakkinen
2022-04-26  8:06               ` [PATCH] char: tpm: cr50_i2c: Suppress duplicated error message in .remove() Uwe Kleine-König
2022-05-04  3:53                 ` Jarkko Sakkinen
2022-05-04  4:06                   ` Jarkko Sakkinen
2022-04-26 11:35               ` [PATCH] char: tpm: cr50_i2c: Drop if with an always false condition Jason Gunthorpe
2022-05-04  4:02                 ` Jarkko Sakkinen [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=YnH65MnQdkpZ10pe@kernel.org \
    --to=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kernel@pengutronix.de \
    --cc=linux-integrity@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).