[PATCH v3 3/3] platform/x86: hsmp: Check ACPI_COMPANION() against NULL
From: Jiale Yao
Date: Mon Jul 13 2026 - 11:33:34 EST
Add a requisite ACPI_COMPANION() check against NULL to the
AMD HSMP acpi probe, aligning with the fix applied to
asus-wireless driver.
Assisted-by: claude:deepseek-v4-pro
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
drivers/platform/x86/amd/hsmp/acpi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c
index 97ed71593bdf..615b3ebe66e7 100644
--- a/drivers/platform/x86/amd/hsmp/acpi.c
+++ b/drivers/platform/x86/amd/hsmp/acpi.c
@@ -71,6 +71,8 @@ static inline int hsmp_get_uid(struct device *dev, u16 *sock_ind)
{
char *uid;
+ if (!ACPI_COMPANION(dev))
+ return -ENODEV;
/*
* UID (ID00, ID01..IDXX) is used for differentiating sockets,
* read it and strip the "ID" part of it and convert the remaining
--
2.34.1