diff options
author | Armin Wolf <[email protected]> | 2023-11-24 19:27:47 +0100 |
---|---|---|
committer | Guenter Roeck <[email protected]> | 2023-11-30 20:12:28 -0800 |
commit | 1fefca6c57fb928d2131ff365270cbf863d89c88 (patch) | |
tree | eaa012cf5fca1bbab3fa3c796647c787afebf109 /scripts/generate_rust_analyzer.py | |
parent | 58ebe7fb6eb2deed0fd05cf57911fea3f36124eb (diff) |
hwmon: (acpi_power_meter) Fix 4.29 MW bug
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: <[email protected]>
Fixes: de584afa5e18 ("hwmon driver for ACPI 4.0 power meters")
Signed-off-by: Armin Wolf <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions