mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
hwmon: (adt7473) Initialize max_duty_at_overheat before use
data->max_duty_at_overheat is not updated in adt7473_update_device, so it might be used before it is initialized (if the user reads from sysfs file max_duty_at_crit before writing to it.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
This commit is contained in:
parent
d38b149794
commit
ed4ec814e4
@ -309,6 +309,9 @@ no_sensor_update:
|
||||
ADT7473_REG_PWM_BHVR(i));
|
||||
}
|
||||
|
||||
i = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4);
|
||||
data->max_duty_at_overheat = !!(i & ADT7473_CFG4_MAX_DUTY_AT_OVT);
|
||||
|
||||
data->limits_last_updated = local_jiffies;
|
||||
data->limits_valid = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user