Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	linux-integrity@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH v1] tpm_crb: Check ACPI_COMPANION() against NULL during probe
Date: Tue, 9 Jun 2026 18:45:36 +0300	[thread overview]
Message-ID: <aig1IKKZYid2BQIB@kernel.org> (raw)
In-Reply-To: <CAJZ5v0iQO_ozXQpzj4qKLegRzMURPDjJV47ynfL6OAUUg_8f4w@mail.gmail.com>

On Mon, Jun 08, 2026 at 07:35:26PM +0200, Rafael J. Wysocki wrote:
> On Tue, May 19, 2026 at 11:01 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Sat, May 16, 2026 at 3:15 AM Jarkko Sakkinen <jarkko@kernel.org> wrote:
> > >
> > > On Tue, May 12, 2026 at 06:16:23PM +0200, Rafael J. Wysocki wrote:
> > > > From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> > > >
> > > > Every platform driver can be forced to match a device that doesn't match
> > > > its list of device IDs because of device_match_driver_override(), so
> > > > platform drivers that rely on the existence of a device's ACPI companion
> > > > object need to verify its presence.
> > > >
> > > > Accordingly, add a requisite ACPI_COMPANION() check against NULL to the
> > > > tpm_crb driver.
> > > >
> > > > Fixes: 48fe2cddc85c ("tpm_crb: Convert ACPI driver to a platform one")
> > > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > > ---
> > > >  drivers/char/tpm/tpm_crb.c |    6 +++++-
> > > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > > >
> > > > --- a/drivers/char/tpm/tpm_crb.c
> > > > +++ b/drivers/char/tpm/tpm_crb.c
> > > > @@ -786,8 +786,8 @@ static int crb_map_pluton(struct device
> > > >  static int crb_acpi_probe(struct platform_device *pdev)
> > > >  {
> > > >       struct device *dev = &pdev->dev;
> > > > -     struct acpi_device *device = ACPI_COMPANION(dev);
> > > >       struct acpi_table_tpm2 *buf;
> > > > +     struct acpi_device *device;
> > > >       struct crb_priv *priv;
> > > >       struct tpm_chip *chip;
> > > >       struct tpm2_crb_smc *crb_smc;
> > > > @@ -797,6 +797,10 @@ static int crb_acpi_probe(struct platfor
> > > >       u32 sm;
> > > >       int rc;
> > > >
> > > > +     device = ACPI_COMPANION(dev);
> > > > +     if (!device)
> > > > +             return -ENODEV;
> > > > +
> > > >       status = acpi_get_table(ACPI_SIG_TPM2, 1,
> > > >                               (struct acpi_table_header **) &buf);
> > > >       if (ACPI_FAILURE(status) || buf->header.length < sizeof(*buf)) {
> > > >
> > > >
> > > >
> > >
> > > Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
> >
> > Thanks!
> >
> > So do you want me to pick up this one?
> 
> I took the silence as consent and picked it up.  If you'd rather route
> it differently, please let me know.

OK my bad in commes, sorry. I did already pick this up and it is
going to my next PR. 

> 
> Thanks!

BR, Jarkko

  reply	other threads:[~2026-06-09 15:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 16:16 [PATCH v1] tpm_crb: Check ACPI_COMPANION() against NULL during probe Rafael J. Wysocki
2026-05-16  1:14 ` Jarkko Sakkinen
2026-05-19 21:01   ` Rafael J. Wysocki
2026-06-08 17:35     ` Rafael J. Wysocki
2026-06-09 15:45       ` Jarkko Sakkinen [this message]
2026-06-09 16:14         ` Rafael J. Wysocki
2026-06-09 16:43           ` 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=aig1IKKZYid2BQIB@kernel.org \
    --to=jarkko@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=rafael@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