Commit 7eb969e0 authored by Armin Wolf's avatar Armin Wolf Committed by Zhao Wenhui
Browse files

hwmon: (hp-wmi-sensors) Check if WMI event data exists

stable inclusion
from stable-v6.6.51
commit 217539e994e53206bbf3fb330261cc78c480d311
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARWCY
CVE: CVE-2024-46768

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=217539e994e53206bbf3fb330261cc78c480d311



--------------------------------

[ Upstream commit a54da9df75cd1b4b5028f6c60f9a211532680585 ]

The BIOS can choose to return no event data in response to a
WMI event, so the ACPI object passed to the WMI notify handler
can be NULL.

Check for such a situation and ignore the event in such a case.

Fixes: 23902f98 ("hwmon: add HP WMI Sensors driver")
Signed-off-by: default avatarArmin Wolf <W_Armin@gmx.de>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Message-ID: <20240901031055.3030-2-W_Armin@gmx.de>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZhao Wenhui <zhaowenhui8@huawei.com>
parent c9fe32fe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1637,6 +1637,8 @@ static void hp_wmi_notify(u32 value, void *context)
		goto out_unlock;

	wobj = out.pointer;
	if (!wobj)
		goto out_unlock;

	err = populate_event_from_wobj(dev, &event, wobj);
	if (err) {