diff options
| author | Huisong Li <[email protected]> | 2025-01-09 08:17:07 +0000 |
|---|---|---|
| committer | Guenter Roeck <[email protected]> | 2025-01-09 20:44:25 +0000 |
| commit | 7532e68f5d8f05353765d7585a791a14985d68b7 (patch) | |
| tree | d89cdfed0c5d42bf2d052611ed0cc181b05b87d1 /drivers/hwmon/pwm-fan.c | |
| parent | hwmon: (core) Use device name as a fallback in devm_hwmon_device_register_wit... (diff) | |
| download | kernel-7532e68f5d8f05353765d7585a791a14985d68b7.tar.gz kernel-7532e68f5d8f05353765d7585a791a14985d68b7.zip | |
hwmon: (acpi_power_meter) Fix uninitialized variables
The 'power1_alarm' attribute uses the 'power' and 'cap' in the
acpi_power_meter_resource structure. Currently, these two fields are just
updated when user query 'power' and 'cap' attribute. If user directly query
the 'power1_alarm' attribute without queryng above two attributes, driver
will use uninitialized variables to judge.
So this patch adds the setting of alarm state and update 'cap' in the
notification callback and update 'power' and 'cap' if needed to show the
real alarm state.
Signed-off-by: Huisong Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'drivers/hwmon/pwm-fan.c')
0 files changed, 0 insertions, 0 deletions
