Re: [PATCH] platform/mellanox: mlxbf-pmc: Check ACPI_COMPANION() against NULL

From: Ilpo Järvinen

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


On Mon, 06 Jul 2026 09:20:56 +0800, Linmao Li wrote:

> 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.
>
> mlxbf_pmc_probe() passes the result of ACPI_COMPANION() to
> acpi_device_hid(), which dereferences it, so force-binding the driver to
> a device without an ACPI companion leads to a NULL pointer dereference.
>
> [...]

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/1] platform/mellanox: mlxbf-pmc: Check ACPI_COMPANION() against NULL
commit: c38cce70adef874c2a7b5132c14d6c221401deff

--
i.