]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/hwmon/lm90.c
hwmon: (lm90) Add range check to set_update_interval
[~shefty/rdma-dev.git] / drivers / hwmon / lm90.c
index bdfd675488aeb5e64b9d4c144c5cfd185ad0ecb0..d2dd5f90496df1ca4393467e31f1ab78264f17d8 100644 (file)
@@ -917,7 +917,7 @@ static ssize_t set_update_interval(struct device *dev,
                return err;
 
        mutex_lock(&data->update_lock);
-       lm90_set_convrate(client, data, val);
+       lm90_set_convrate(client, data, SENSORS_LIMIT(val, 0, 100000));
        mutex_unlock(&data->update_lock);
 
        return count;