From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 968B03FB7DC; Tue, 9 Jun 2026 16:43:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781023408; cv=none; b=pF2jH2Kp1cUfVlG9wzi/gb/aFSFdJ/AwwFVyxnQ0oRfQ2XT+DJuPl416GEy42UTicg0NHpLPEkit4dPRzBbE3Zlbt7y+jf2oJ+FyTt4kPQtxfW5JE3RAjxnwOpO5oYjfOrM2nQ8dSmv1wqzHxJSu3Ipx6F2z3njh/pTj7pUl+tI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781023408; c=relaxed/simple; bh=2DBVRpC1v/KJoyF9Kaocr06G9aykvgCgi+0KWYst/kE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HM4DuJCq6u5rhrGuary2aUsNxqbIhnbgHrzi+oz1+z4dAry/zGTt09p3//JRNZ6lxgFmu6r8AqAOelERilgu2Hxg5ptz200FhuWEIC5fd0H3vZf68frBwcBtiyyQZAJaINn2jsgXzWQYsHt8rVZJQcubx1sE4SCtPVyo8VVkem4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eAUxAuNB; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eAUxAuNB" Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id ED7561F00893; Tue, 9 Jun 2026 16:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781023407; bh=HJSYg34zMAkJCj1Kpji5PzSYjMNlzzV3vN9iTiexrNE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=eAUxAuNBuMNZaW6tOu45LStIcB7Y3DQY0GnJEN7CaXf0Twel0fcWJmiN6qxbt7TYz 87CED5Yc7++q6Zl3f8yqwtBKS1X5f0ayxRNhIGK7efkRKXt+Uve47N/h8xNohCbYyC B2OYr5w2gdPv0NrPROhb7uQcDp2sTebCW+/Yt3BY7moGkL1koZKJoUvo+QZLbb74Lm cMYEOkg3lvIWnLMj02op9EcoQ2S2SlXyK5ukxnJdbtSblDWPm3U4NpoNh9FwOmSgkB Tpp56nee+5C8QdchS6t09l/CrnKJJppT/ybvVO7qJaOLLsjSRdkwTNMaIYvnOQ7gx1 iljzYngjP6Iwg== Date: Tue, 9 Jun 2026 19:43:23 +0300 From: Jarkko Sakkinen To: "Rafael J. Wysocki" Cc: Peter Huewe , Jason Gunthorpe , linux-integrity@vger.kernel.org, Andy Shevchenko , LKML , Linux ACPI Subject: Re: [PATCH v1] tpm_crb: Check ACPI_COMPANION() against NULL during probe Message-ID: References: <2848144.mvXUDI8C0e@rafael.j.wysocki> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Jun 09, 2026 at 06:14:47PM +0200, Rafael J. Wysocki wrote: > On Tue, Jun 9, 2026 at 5:45 PM Jarkko Sakkinen wrote: > > > > 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 wrote: > > > > > > > > On Sat, May 16, 2026 at 3:15 AM Jarkko Sakkinen wrote: > > > > > > > > > > On Tue, May 12, 2026 at 06:16:23PM +0200, Rafael J. Wysocki wrote: > > > > > > From: "Rafael J. Wysocki" > > > > > > > > > > > > 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 > > > > > > --- > > > > > > 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 > > > > > > > > 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. > > OK, I'll drop it then, thanks! NP, and apologies for causing extra trouble! BR, Jarkko