diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-08-05 20:24:54 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-05 22:44:42 -0400 |
commit | 5e3b5610f921701b235fc9a1bb17c040224bd76e (patch) | |
tree | beae4e5b34a0bf1661b716e478bca5ae0d266dac /drivers/hwmon/pc87360.c | |
parent | fa642d9d6e502fbdbd1122a6a247c8ad17063a29 (diff) |
hwmon: (pc87360) 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/pc87360.c')
-rw-r--r-- | drivers/hwmon/pc87360.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c index 988181e4cfcd..145f674c1d87 100644 --- a/drivers/hwmon/pc87360.c +++ b/drivers/hwmon/pc87360.c | |||
@@ -615,6 +615,9 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, | |||
615 | if (err) | 615 | if (err) |
616 | return err; | 616 | return err; |
617 | 617 | ||
618 | if (val > 255) | ||
619 | return -EINVAL; | ||
620 | |||
618 | data->vrm = val; | 621 | data->vrm = val; |
619 | return count; | 622 | return count; |
620 | } | 623 | } |