mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
hwmon: (lm90) Add range check to set_update_interval
When writing the update_interval attribute, the parameter value was not range checked, which could cause an integer overflow and result in an arbitrary update interval. Fix by limiting the value range to <0, 100000>. Reported-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
This commit is contained in:
parent
2fe28ab51d
commit
6b101116ae
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue