提交 ed4ec814 编写于 作者: J Jean Delvare 提交者: Mark M. Hoffman

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: NJean Delvare <khali@linux-fr.org>
Acked-by: NDarrick J. Wong <djwong@us.ibm.com>
Signed-off-by: NMark M. Hoffman <mhoffman@lightlink.com>
上级 d38b1497
......@@ -309,6 +309,9 @@ static struct adt7473_data *adt7473_update_device(struct device *dev)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册