Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Cc: stable@vger.kernel.org
Reported-by: Gal Hammer <galhammer@gmail.com>
Tested-by: Gal Hammer <galhammer@gmail.com>
Fixes: 07ac275981b1 ("platform/x86: alienware-wmi-wmax: Add support for manual fan control")
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://patch.msgid.link/20251014-sleep-fix-v3-1-b5cb58da4638@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Kurt Borja and committed by
Ilpo Järvinen
a49c4d48 3a866087

+2 -2
+2 -2
drivers/platform/x86/dell/alienware-wmi-wmax.c
··· 1639 1639 1640 1640 static int wmax_wmi_suspend(struct device *dev) 1641 1641 { 1642 - if (awcc->hwmon) 1642 + if (awcc && awcc->hwmon) 1643 1643 awcc_hwmon_suspend(dev); 1644 1644 1645 1645 return 0; ··· 1647 1647 1648 1648 static int wmax_wmi_resume(struct device *dev) 1649 1649 { 1650 - if (awcc->hwmon) 1650 + if (awcc && awcc->hwmon) 1651 1651 awcc_hwmon_resume(dev); 1652 1652 1653 1653 return 0;