summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorKurt Borja <kuurtb@gmail.com>2025-10-14 05:07:27 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-29 14:10:22 +0100
commit24c3812c9e817d19e4842d7495561594de1ddcb4 (patch)
treee7c0c3d4ee15751befb9542d5f1932ce81bc42bc /drivers/platform
parent9aac08036ae577b4c60533c60ee3f33a91e9437a (diff)
downloadlinux-24c3812c9e817d19e4842d7495561594de1ddcb4.tar.gz
linux-24c3812c9e817d19e4842d7495561594de1ddcb4.tar.bz2
linux-24c3812c9e817d19e4842d7495561594de1ddcb4.zip
platform/x86: alienware-wmi-wmax: Fix NULL pointer dereference in sleep handlers
commit a49c4d48c3b60926e6a8cec217bf95aa65388ecc upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/dell/alienware-wmi-wmax.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/dell/alienware-wmi-wmax.c b/drivers/platform/x86/dell/alienware-wmi-wmax.c
index 3b25a8283bbd..f417dcc9af35 100644
--- a/drivers/platform/x86/dell/alienware-wmi-wmax.c
+++ b/drivers/platform/x86/dell/alienware-wmi-wmax.c
@@ -1647,7 +1647,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;
@@ -1655,7 +1655,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;