From: Jason Gunthorpe <jgg@ziepe.ca>
To: Jarkko Sakkinen <jarkko@kernel.org>
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: Tue, 26 Apr 2022 08:35:41 -0300 [thread overview]
Message-ID: <20220426113541.GA64706@ziepe.ca> (raw)
In-Reply-To: <cf3df097d436c9b54c710401783667b56931b9b8.camel@kernel.org>
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
next prev parent reply other threads:[~2022-04-26 11:35 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 ` Jason Gunthorpe [this message]
2022-05-04 4:02 ` [PATCH] char: tpm: cr50_i2c: Drop if with an always false condition Jarkko Sakkinen
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=20220426113541.GA64706@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=jarkko@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.