Re: [PATCH 0/2] platform/surface: Check ACPI companion during probe

From: Ilpo Järvinen

Date: Fri Jul 10 2026 - 13:19:10 EST


On Mon, 06 Jul 2026 09:25:10 +0800, Linmao Li wrote:

> 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.
>
> [...]

Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.

The list of commits applied:
[1/2] platform/surface: acpi-notify: Check ACPI companion before use
commit: 2b3a5dabe89e330413af403246b648c1890f368f
[2/2] platform/surface: surfacepro3_button: Check ACPI companion before use
(no commit info)

--
i.