[PATCH 0/2] platform/surface: Check ACPI companion during probe
From: Linmao Li
Date: Sun Jul 05 2026 - 21:25:33 EST
Since 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(),
platform drivers that rely on the existence of a device's ACPI companion
object should verify its presence.
Commit e4865a56d013 ("ACPI: driver: Check ACPI_COMPANION() against NULL
during probe") added such checks to the core ACPI platform drivers, but
two drivers under platform/surface dereference the result of
ACPI_COMPANION() in their probe functions without checking it, leading
to a NULL pointer dereference when force-bound to a device without an
ACPI companion. Add the same checks there.
Linmao Li (2):
platform/surface: acpi-notify: Check ACPI companion before use
platform/surface: surfacepro3_button: Check ACPI companion before use
drivers/platform/surface/surface_acpi_notify.c | 6 +++++-
drivers/platform/surface/surfacepro3_button.c | 9 +++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
--
2.25.1