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 3/5] platform/x86: intel-hid: Check ACPI_HANDLE() against NULL
Date: Tue, 12 May 2026 17:13:28 +0200	[thread overview]
Message-ID: <1971512.tdWV9SEqCh@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-hid driver.

Fixes: ecc83e52b28c ("intel-hid: new hid event driver for hotkeys")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/x86/intel/hid.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/platform/x86/intel/hid.c
+++ b/drivers/platform/x86/intel/hid.c
@@ -688,12 +688,16 @@ static bool button_array_present(struct
 
 static int intel_hid_probe(struct platform_device *device)
 {
-	acpi_handle handle = ACPI_HANDLE(&device->dev);
 	unsigned long long mode, dummy;
 	struct intel_hid_priv *priv;
+	acpi_handle handle;
 	acpi_status status;
 	int err;
 
+	handle = ACPI_HANDLE(&device->dev);
+	if (!handle)
+		return -ENODEV;
+
 	intel_hid_init_dsm(handle);
 
 	if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_HDMM_FN, &mode)) {




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

Thread overview: 7+ 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 ` Rafael J. Wysocki [this message]
2026-05-12 15:15 ` [PATCH v2 4/5] platform/x86: intel_sar: Check ACPI_HANDLE() " Rafael J. Wysocki
2026-05-12 15:16 ` [PATCH v2 5/5] platform/x86: intel-vbtn: " Rafael J. Wysocki
2026-05-12 17:59 ` [PATCH v2 0/5] platform/x86: Check ACPI_COMPANION() or " Andy Shevchenko

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=1971512.tdWV9SEqCh@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