[PATCH] platform/x86: asus-wireless: Check ACPI_COMPANION() against NULL

From: Jiale Yao

Date: Sun Jul 12 2026 - 11:18:44 EST


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_COMPANION() check against NULL to the
asus-wireless driver.

Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
drivers/platform/x86/asus-wireless.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c
index 2b494bf3cba8..54052bda9061 100644
--- a/drivers/platform/x86/asus-wireless.c
+++ b/drivers/platform/x86/asus-wireless.c
@@ -132,6 +132,9 @@ static int asus_wireless_probe(struct platform_device *pdev)
const struct acpi_device_id *id;
int err;

+ if (!adev)
+ return -ENODEV;
+
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
--
2.34.1