diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-08-06 08:20:45 +0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-05 19:44:36 -0700 |
commit | a4461647f66c6e12676f9e9ce43c1578a2ba02a1 (patch) | |
tree | 17b52b4c2b66754fe6a50a83b621207d3fd5c0cb /drivers/hwmon | |
parent | 9c8ae7287a51d0fdc2e3547068afccfc4880e902 (diff) | |
download | op-kernel-dev-a4461647f66c6e12676f9e9ce43c1578a2ba02a1.zip op-kernel-dev-a4461647f66c6e12676f9e9ce43c1578a2ba02a1.tar.gz |
hwmon: (adm1026) 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/adm1026.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index ca8430f..e67b9a5 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c @@ -1085,6 +1085,9 @@ static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, if (err) return err; + if (val > 255) + return -EINVAL; + data->vrm = val; return count; } |