Unverified Commit a49c4d48 authored by Kurt Borja's avatar Kurt Borja Committed by Ilpo Järvinen
Browse files

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: default avatarGal Hammer <galhammer@gmail.com>
Tested-by: default avatarGal Hammer <galhammer@gmail.com>
Fixes: 07ac2759 ("platform/x86: alienware-wmi-wmax: Add support for manual fan control")
Signed-off-by: default avatarKurt Borja <kuurtb@gmail.com>
Link: https://patch.msgid.link/20251014-sleep-fix-v3-1-b5cb58da4638@gmail.com


Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 3a866087
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;