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: 07ac275981 ("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>
This commit is contained in:
Kurt Borja 2025-10-14 05:07:27 -05:00 committed by Ilpo Järvinen
parent 3a86608788
commit a49c4d48c3
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31
1 changed files with 2 additions and 2 deletions

View File

@ -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;