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 4/5] platform/x86: intel_sar: Check ACPI_HANDLE() against NULL
Date: Tue, 12 May 2026 17:15:32 +0200	[thread overview]
Message-ID: <14023870.uLZWGnKmhe@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_sar driver.

Fixes: dcfbd31ef4bc ("platform/x86: BIOS SAR driver for Intel M.2 Modem")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/x86/intel/int1092/intel_sar.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/platform/x86/intel/int1092/intel_sar.c
+++ b/drivers/platform/x86/intel/int1092/intel_sar.c
@@ -245,15 +245,20 @@ static void sar_get_data(int reg, struct
 static int sar_probe(struct platform_device *device)
 {
 	struct wwan_sar_context *context;
+	acpi_handle handle;
 	int reg;
 	int result;
 
+	handle = ACPI_HANDLE(&device->dev);
+	if (!handle)
+		return -ENODEV;
+
 	context = kzalloc_obj(*context);
 	if (!context)
 		return -ENOMEM;
 
 	context->sar_device = device;
-	context->handle = ACPI_HANDLE(&device->dev);
+	context->handle = handle;
 	dev_set_drvdata(&device->dev, context);
 
 	result = guid_parse(SAR_DSM_UUID, &context->guid);




  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 ` Rafael J. Wysocki [this message]
2026-05-12 15:16 ` [PATCH v2 5/5] platform/x86: intel-vbtn: " 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=14023870.uLZWGnKmhe@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