X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fhwmon%2Fds620.c;h=0043a4c02b85b4007d1972e50709801510df1a1d;hb=e46c9b02e2422e7b8f8a63ff53f1f8eddc23b247;hp=edf550fc4eef5c1b2cbbcd94365e7259e1a2049c;hpb=eca9fdf32dd48976eab18d310acb0b8d4cc9bf26;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/hwmon/ds620.c b/drivers/hwmon/ds620.c index edf550fc4eef..0043a4c02b85 100644 --- a/drivers/hwmon/ds620.c +++ b/drivers/hwmon/ds620.c @@ -166,7 +166,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da, if (res) return res; - val = (val * 10 / 625) * 8; + val = (clamp_val(val, -128000, 128000) * 10 / 625) * 8; mutex_lock(&data->update_lock); data->temp[attr->index] = val;