diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-08-05 20:25:44 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-05 22:44:42 -0400 |
commit | 5c570b9573ecabf3ffc9af7f03daa088f2466d7b (patch) | |
tree | cff7769a074bc5d3e81541d15fce7e31b1383cbc /drivers/hwmon | |
parent | 5e3b5610f921701b235fc9a1bb17c040224bd76e (diff) |
hwmon: (vt1211) 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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/vt1211.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwmon/vt1211.c b/drivers/hwmon/vt1211.c index 344b22ec2553..3ea57c3504e2 100644 --- a/drivers/hwmon/vt1211.c +++ b/drivers/hwmon/vt1211.c | |||
@@ -879,6 +879,9 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, | |||
879 | if (err) | 879 | if (err) |
880 | return err; | 880 | return err; |
881 | 881 | ||
882 | if (val > 255) | ||
883 | return -EINVAL; | ||
884 | |||
882 | data->vrm = val; | 885 | data->vrm = val; |
883 | 886 | ||
884 | return count; | 887 | return count; |