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 1ACD236D9E8; Tue, 9 Jun 2026 15:45:39 +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=1781019941; cv=none; b=UVCYPWBDrDu4LEbpmTK0Fy5zBlUabg/lUJdV2XU3/3NpX8dIwPQcUU3OKBLiG5IzdhUPbBkzxx8IEYETgYE8zsGuzIk6vbYbHQMe1Qa/nWpYbyFFcfUr2qwFxXjIkEnRveCtYkcJLZKCpcc51DCBh85Epkogp6MwrBmCxnKupd4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781019941; c=relaxed/simple; bh=d00WZ7n4qiROgFaKT1MqmkwSYlrH5OGbyudYllffNhI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CxE3aKPRJV74k7WPHvWbaqFSoMmOQ8rfMb7Dq5qQe20W9sBomM4V7+CJpQnC/8ep4mGSCEIRT2JDxtTKZiKILhoX1ZRKgaUVEU5MV5EPBUTbtjyUh2nLPRlxvWVA7VfkDfcM92tZ8AcZhg9V1d1sSW6zigC8mAH0btAX//XAK/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HYU3B7nl; 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="HYU3B7nl" Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id 2CDC21F00899; Tue, 9 Jun 2026 15:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781019939; bh=rkoRNjuCtCuZgM1S2mfY+RwDxl51UaHcMP/HJiUpPAI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HYU3B7nlj5/hkultzgeFuZ2vm582UXZCg+GFvueu+hiD4hoFr+zddZvXv7uq7ksgr mL7lIVJ/ZCFYXJjnDYVrIq6idrFDT0D7vOd7sYgLXGJgm/dAD29wm2/ZkiQTNJgnaG TC1I+TZwJTxN9/tGFu+E2gPD1ydjTX/pOWoSoFbBO2rggp6vhaICx65jWWFCeLp0B3 FpjpTUN2eiiJ5nUpfmKJVtpD227aSJWZBKtbs2kpkn2xGQVUohESC3Xi7kc3Ypj4cp 4PTjOiGoEsi3wm0SaUNClrU66pF3ml2rxBdrZWRr97LKVISY4swkXZk7L4Xwbsi907 2r7geH+eBvW8Q== Date: Tue, 9 Jun 2026 18:45:36 +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-integrity@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 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. > > Thanks! BR, Jarkko