Skip to content

Commit a49c4d4

Browse files
kuu-rtij-intel
authored andcommitted
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: 07ac275 ("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>
1 parent 3a86608 commit a49c4d4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/platform/x86/dell/alienware-wmi-wmax.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,15 +1639,15 @@ static int wmax_wmi_probe(struct wmi_device *wdev, const void *context)
16391639

16401640
static int wmax_wmi_suspend(struct device *dev)
16411641
{
1642-
if (awcc->hwmon)
1642+
if (awcc && awcc->hwmon)
16431643
awcc_hwmon_suspend(dev);
16441644

16451645
return 0;
16461646
}
16471647

16481648
static int wmax_wmi_resume(struct device *dev)
16491649
{
1650-
if (awcc->hwmon)
1650+
if (awcc && awcc->hwmon)
16511651
awcc_hwmon_resume(dev);
16521652

16531653
return 0;

0 commit comments

Comments
 (0)