From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "Hans de Goede" <hansg@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Linux ACPI" <linux-acpi@vger.kernel.org>,
"Corentin Chary" <corentin.chary@gmail.com>,
"Luke D. Jones" <luke@ljones.dev>,
"Denis Benato" <denis.benato@linux.dev>,
"Pali Rohár" <pali@kernel.org>,
"Jonathan Woithe" <jwoithe@just42.net>,
"Robert Gerlach" <khnz@gmx.de>,
"Matan Ziv-Av" <matan@svgalib.org>,
"Kenneth Chan" <kenneth.t.chan@gmail.com>,
"Mattia Dongili" <malattia@linux.it>,
"Jeremy Soller" <jeremy@system76.com>,
"Azael Avalos" <coproscefalo@gmail.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
platform-driver-x86@vger.kernel.org
Subject: [PATCH v2 13/16] platform/x86: toshiba_acpi: Check ACPI_COMPANION() against NULL
Date: Tue, 12 May 2026 16:15:31 +0200 [thread overview]
Message-ID: <1973170.CQOukoFCf9@rafael.j.wysocki> (raw)
In-Reply-To: <12904885.O9o76ZdvQC@rafael.j.wysocki>
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
platform/x86 toshiba_acpi driver.
Fixes: 246d6cefe525 ("platform/x86: toshiba_acpi: Convert ACPI driver to a platform one")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/platform/x86/toshiba_acpi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 35d899c01740..7cecb3a70b9c 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -3374,7 +3374,7 @@ static const struct dmi_system_id toshiba_dmi_quirks[] __initconst = {
static int toshiba_acpi_probe(struct platform_device *pdev)
{
- struct acpi_device *acpi_dev = ACPI_COMPANION(&pdev->dev);
+ struct acpi_device *acpi_dev;
struct toshiba_acpi_dev *dev;
const char *hci_method;
u32 dummy;
@@ -3383,6 +3383,10 @@ static int toshiba_acpi_probe(struct platform_device *pdev)
if (toshiba_acpi)
return -EBUSY;
+ acpi_dev = ACPI_COMPANION(&pdev->dev);
+ if (!acpi_dev)
+ return -ENODEV;
+
pr_info("Toshiba Laptop ACPI Extras version %s\n",
TOSHIBA_ACPI_VERSION);
--
2.51.0
next prev parent reply other threads:[~2026-05-12 14:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 14:01 [PATCH v2 00/16] platform/x86: Check ACPI_COMPANION() against NULL during probe Rafael J. Wysocki
2026-05-12 14:03 ` [PATCH v2 01/16] platform/x86: acer-wireless: Check ACPI_COMPANION() against NULL Rafael J. Wysocki
2026-05-12 14:04 ` [PATCH v2 02/16] platform/x86: asus-laptop: " Rafael J. Wysocki
2026-05-12 14:05 ` [PATCH v2 03/16] platform/x86: dell/dell-rbtn: " Rafael J. Wysocki
2026-05-12 14:05 ` [PATCH v2 04/16] platform/x86: eeepc-laptop: " Rafael J. Wysocki
2026-05-12 14:08 ` [PATCH v2 05/16] platform/x86: fujitsu: " Rafael J. Wysocki
2026-05-12 14:09 ` [PATCH v2 06/16] platform/x86: fujitsu-tablet: " Rafael J. Wysocki
2026-05-12 14:11 ` [PATCH v2 07/16] platform/x86: intel/rst: " Rafael J. Wysocki
2026-05-12 14:11 ` [PATCH v2 08/16] platform/x86: intel/smartconnect: Check ACPI_HANDLE() " Rafael J. Wysocki
2026-05-12 14:12 ` [PATCH v2 09/16] platform/x86: lg-laptop: Check ACPI_COMPANION() " Rafael J. Wysocki
2026-05-12 14:13 ` [PATCH v2 10/16] platform/x86: panasonic-laptop: " Rafael J. Wysocki
2026-05-12 14:13 ` [PATCH v2 11/16] platform/x86: sony-laptop: " Rafael J. Wysocki
2026-05-12 14:14 ` [PATCH v2 12/16] platform/x86: system76: " Rafael J. Wysocki
2026-05-12 14:15 ` Rafael J. Wysocki [this message]
2026-05-12 14:16 ` [PATCH v2 14/16] platform/x86: toshiba_bluetooth: " Rafael J. Wysocki
2026-05-12 14:17 ` [PATCH v2 15/16] platform/x86: toshiba_haps: " Rafael J. Wysocki
2026-05-12 14:17 ` [PATCH v2 16/16] platform/x86: wireless-hotkey: " Rafael J. Wysocki
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=1973170.CQOukoFCf9@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=coproscefalo@gmail.com \
--cc=corentin.chary@gmail.com \
--cc=denis.benato@linux.dev \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jeremy@system76.com \
--cc=jwoithe@just42.net \
--cc=kenneth.t.chan@gmail.com \
--cc=khnz@gmx.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luke@ljones.dev \
--cc=malattia@linux.it \
--cc=matan@svgalib.org \
--cc=pali@kernel.org \
--cc=platform-driver-x86@vger.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