When updating vrm, the value range was not limited. This could result in more or less random vrm values if the value provided by the user was larger than 255. Fix by limiting the range to 0..255 using the SENSORS_LIMIT macro. Cc: Juerg Haefliger <juergh@xxxxxxxxx> Signed-off-by: Guenter Roeck <guenter.roeck@xxxxxxxxxxxx> --- drivers/hwmon/dme1737.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c index e7c6a19..81b6fbd 100644 --- a/drivers/hwmon/dme1737.c +++ b/drivers/hwmon/dme1737.c @@ -1480,14 +1480,14 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct dme1737_data *data = dev_get_drvdata(dev); - long val; + unsigned long val; int err; - err = kstrtol(buf, 10, &val); + err = kstrtoul(buf, 10, &val); if (err) return err; - data->vrm = val; + data->vrm = SENSORS_LIMIT(val, 0, 255); return count; } -- 1.7.3.1 _______________________________________________ lm-sensors mailing list lm-sensors@xxxxxxxxxxxxxx http://lists.lm-sensors.org/mailman/listinfo/lm-sensors