diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-08-06 02:19:43 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-06 04:44:36 +0200 |
commit | 9c8ae7287a51d0fdc2e3547068afccfc4880e902 (patch) | |
tree | d8c9a0b7de51defda9f88307496f6fb17fa20998 /drivers/hwmon/adm1025.c | |
parent | hwmon: (hih6130) Fix missing hih6130->write_length setting (diff) | |
download | linux-9c8ae7287a51d0fdc2e3547068afccfc4880e902.tar.xz linux-9c8ae7287a51d0fdc2e3547068afccfc4880e902.zip |
hwmon: (adm1025) 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/adm1025.c')
-rw-r--r-- | drivers/hwmon/adm1025.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c index d3d0e8cf27b4..d6c767ace916 100644 --- a/drivers/hwmon/adm1025.c +++ b/drivers/hwmon/adm1025.c @@ -382,6 +382,9 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, if (err) return err; + if (val > 255) + return -EINVAL; + data->vrm = val; return count; } |