Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH v1] hwmon: (asus_atk0110) Check ACPI_COMPANION() against NULL
@ 2026-05-11 19:56 Rafael J. Wysocki
  2026-05-12 18:33 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2026-05-11 19:56 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-hwmon, LKML, Linux ACPI, Andy Shevchenko, Linux PM,
	Luca Tettamanti

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
asus_atk0110 hwmon driver.

Fixes: ee1752590733 ("hwmon: (asus_atk0110) Convert ACPI driver to a platform one")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/hwmon/asus_atk0110.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -1273,15 +1273,20 @@ static int atk_probe(struct platform_dev
 	struct acpi_buffer buf;
 	union acpi_object *obj;
 	struct atk_data *data;
+	acpi_handle handle;
 
 	dev_dbg(&pdev->dev, "adding...\n");
 
+	handle = ACPI_HANDLE(&pdev->dev);
+	if (!handle)
+		return -ENODEV;
+
 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;
 
 	data->dev = &pdev->dev;
-	data->atk_handle = ACPI_HANDLE(&pdev->dev);
+	data->atk_handle = handle;
 	INIT_LIST_HEAD(&data->sensor_list);
 	data->disable_ec = false;
 




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] hwmon: (asus_atk0110) Check ACPI_COMPANION() against NULL
  2026-05-11 19:56 [PATCH v1] hwmon: (asus_atk0110) Check ACPI_COMPANION() against NULL Rafael J. Wysocki
@ 2026-05-12 18:33 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2026-05-12 18:33 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-hwmon, LKML, Linux ACPI, Andy Shevchenko, Linux PM,
	Luca Tettamanti

On Mon, May 11, 2026 at 09:56:14PM +0200, Rafael J. Wysocki wrote:
> 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
> asus_atk0110 hwmon driver.
> 
> Fixes: ee1752590733 ("hwmon: (asus_atk0110) Convert ACPI driver to a platform one")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Applied.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-12 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 19:56 [PATCH v1] hwmon: (asus_atk0110) Check ACPI_COMPANION() against NULL Rafael J. Wysocki
2026-05-12 18:33 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox