diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-08-06 08:21:49 +0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-05 19:44:36 -0700 |
commit | db59ac434230c2d6c051bb314f320ad977e6841d (patch) | |
tree | cc744c60dd7042b99b066d876b9611579abc4c2d /drivers/hwmon/asb100.c | |
parent | a4461647f66c6e12676f9e9ce43c1578a2ba02a1 (diff) | |
download | linux-db59ac434230c2d6c051bb314f320ad977e6841d.tar.bz2 |
hwmon: (asb100) 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/asb100.c')
-rw-r--r-- | drivers/hwmon/asb100.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index f96063680e58..272fcc837ecc 100644 --- a/drivers/hwmon/asb100.c +++ b/drivers/hwmon/asb100.c @@ -510,6 +510,10 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, err = kstrtoul(buf, 10, &val); if (err) return err; + + if (val > 255) + return -EINVAL; + data->vrm = val; return count; } |