Skip to contentSkip to conversation

platform/x86: alienware-wmi-wmax: Fix null pointer dereference in sleep handlers

PATCH In review Kurt Borja 2 participants 2 messages Oct 14, 2025 – Oct 15, 2025

Subsystems (3)
lore
Share & tools
lore

Kurt Borja

author maintainer
#0 lore raw

PATCH v3 1/1 platform/x86: alienware-wmi-wmax: Fix null pointer dereference in sleep handlers

Devices without the AWCC interface don't initialize awcc. Add a check before dereferencing it in sleep handlers.

Fixes 07ac275981b1 ("platform/x86: alienware-wmi-wmax: Add support for manual fan control")

---
Changes in v3:
- Fix typo in title
- Go for a simpler approach because the last one prevented the old driver interface from loading
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Little logic mistake in the force_gmode path... (oops)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 drivers/platform/x86/dell/alienware-wmi-wmax.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/dell/alienware-wmi-wmax.c +2 -2
index 31f9643a6a3b..b106e8e407b3 100644
@@ -1639,7 +1639,7 @@ static int wmax_wmi_probe(struct wmi_device *wdev, const void *context)
 
 static int wmax_wmi_suspend(struct device *dev)
 {
-	if (awcc->hwmon)
+	if (awcc && awcc->hwmon)
 		awcc_hwmon_suspend(dev);
 
 	return 0;
@@ -1647,7 +1647,7 @@ static int wmax_wmi_suspend(struct device *dev)
 
 static int wmax_wmi_resume(struct device *dev)
 {
-	if (awcc->hwmon)
+	if (awcc && awcc->hwmon)
 		awcc_hwmon_resume(dev);
 
 	return 0;

---
base-commit: 3ed17349f18774c24505b0c21dfbd3cc4f126518
change-id: 20251012-sleep-fix-5d0596dd92a3

Signature · 1 line
 ~ Kurt
maintainer
#1 lore raw
Quoted 4 lines · Kurt Borja

Devices without the AWCC interface don't initialize awcc. Add a check before dereferencing it in sleep handlers.

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

The list of commits applied:
[1/1] platform/x86: alienware-wmi-wmax: Fix null pointer dereference in sleep handlers

      commit: a49c4d48c3b60926e6a8cec217bf95aa65388ecc

--
i.