Linux ACPI
 help / color / mirror / Atom feed
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>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	Andrea Ho <Andrea.Ho@advantech.com.tw>,
	Eric Piel <eric.piel@tremplin-utc.net>,
	Alex Hung <alexhung@gmail.com>,
	Shravan Sudhakar <s.shravan@intel.com>,
	AceLan Kao <acelan.kao@canonical.com>
Subject: [PATCH v2 5/5] platform/x86: intel-vbtn: Check ACPI_HANDLE() against NULL
Date: Tue, 12 May 2026 17:16:22 +0200	[thread overview]
Message-ID: <3426431.aeNJFYEL58@rafael.j.wysocki> (raw)
In-Reply-To: <6007701.DvuYhMxLoT@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_HANDLE() check against NULL to the
platform/x86 intel-vbtn driver.

Fixes: 26173179fae1 ("platform/x86: intel-vbtn: Eval VBDL after registering our notifier")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/x86/intel/vbtn.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/platform/x86/intel/vbtn.c
+++ b/drivers/platform/x86/intel/vbtn.c
@@ -275,12 +275,16 @@ static bool intel_vbtn_has_switches(acpi
 
 static int intel_vbtn_probe(struct platform_device *device)
 {
-	acpi_handle handle = ACPI_HANDLE(&device->dev);
 	bool dual_accel, has_buttons, has_switches;
 	struct intel_vbtn_priv *priv;
+	acpi_handle handle;
 	acpi_status status;
 	int err;
 
+	handle = ACPI_HANDLE(&device->dev);
+	if (!handle)
+		return -ENODEV;
+
 	dual_accel = dual_accel_detect();
 	has_buttons = acpi_has_method(handle, "VBDL");
 	has_switches = intel_vbtn_has_switches(handle, dual_accel);




      parent reply	other threads:[~2026-05-12 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 15:10 [PATCH v2 0/5] platform/x86: Check ACPI_COMPANION() or ACPI_HANDLE() against NULL Rafael J. Wysocki
2026-05-12 15:11 ` [PATCH v2 1/5] platform/x86: adv_swbutton: Check " Rafael J. Wysocki
2026-05-12 15:12 ` [PATCH v2 2/5] platform/x86: hp_accel: Check ACPI_COMPANION() " Rafael J. Wysocki
2026-05-12 15:13 ` [PATCH v2 3/5] platform/x86: intel-hid: Check ACPI_HANDLE() " Rafael J. Wysocki
2026-05-12 15:15 ` [PATCH v2 4/5] platform/x86: intel_sar: " Rafael J. Wysocki
2026-05-12 15:16 ` Rafael J. Wysocki [this message]

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=3426431.aeNJFYEL58@rafael.j.wysocki \
    --to=rafael@kernel.org \
    --cc=Andrea.Ho@advantech.com.tw \
    --cc=acelan.kao@canonical.com \
    --cc=alexhung@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=s.shravan@intel.com \
    /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