hwmon: (w83791d) Fix vrm value range
Subsystems (2)
PATCH 18/79 hwmon: (w83791d) Fix vrm value range
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 Charles Spirakis <[email protected]>
Cc Marc Hulsman <[email protected]>
Signed-off-by Guenter Roeck <[email protected]>
--- drivers/hwmon/w83791d.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/w83791d.c +1 -1
@@ -1184,7 +1184,7 @@ static ssize_t store_vrm_reg(struct device *dev,if (err)return err; - data->vrm = val; + data->vrm =SENSORS_LIMIT (val,0 ,255 );return count; }
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors