Unverified Commit edb6b9ec authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12278 hwmon: (nct6775-core) Fix underflows seen when writing limit attributes

parents 603dff42 91efecb1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2264,7 +2264,7 @@ store_temp_offset(struct device *dev, struct device_attribute *attr,
	if (err < 0)
		return err;

	val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127);
	val = DIV_ROUND_CLOSEST(clamp_val(val, -128000, 127000), 1000);

	mutex_lock(&data->update_lock);
	data->temp_offset[nr] = val;