commit | fe04f24b831cf384eda9798e1af642b96ca19d29 | [log] [tgz] |
---|---|---|
author | Axel Lin <axel.lin@ingics.com> | Wed Aug 06 08:28:02 2014 +0800 |
committer | Guenter Roeck <linux@roeck-us.net> | Tue Aug 05 19:44:42 2014 -0700 |
tree | c17cc9942e42391da0cc6842878b321a439af691 | |
parent | 970255b75d0b54e457091182a7ae3a188ac0c346 [diff] |
hwmon: (w83791d) Fix vrm write operation vrm is an u8, so the written value needs to be limited to [0, 255]. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c index cb3765f..001df856 100644 --- a/drivers/hwmon/w83791d.c +++ b/drivers/hwmon/w83791d.c
@@ -1181,6 +1181,9 @@ if (err) return err; + if (val > 255) + return -EINVAL; + data->vrm = val; return count; }