summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2023-11-24 19:27:47 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-12-13 17:42:17 +0100
commit19f671d446ee9a8c4e40a85288496e6fd68334c9 (patch)
tree32abefd16e56b6d3b2c7bec6fcc07af632a398cb /kernel
parent98936b782e71fc5c2fa613921aa0bcbb674ad9b5 (diff)
hwmon: (acpi_power_meter) Fix 4.29 MW bug
[ Upstream commit 1fefca6c57fb928d2131ff365270cbf863d89c88 ] The ACPI specification says: "If an error occurs while obtaining the meter reading or if the value is not available then an Integer with all bits set is returned" Since the "integer" is 32 bits in case of the ACPI power meter, userspace will get a power reading of 2^32 * 1000 miliwatts (~4.29 MW) in case of such an error. This was discovered due to a lm_sensors bugreport (https://github.com/lm-sensors/lm-sensors/issues/460). Fix this by returning -ENODATA instead. Tested-by: <urbinek@gmail.com> Fixes: de584afa5e18 ("hwmon driver for ACPI 4.0 power meters") Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20231124182747.13956-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions