diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-01-18 17:29:32 -0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2015-01-25 21:23:59 -0800 |
commit | 3a05633b042fb4aea65b09ce2d0d43689df6eb9a (patch) | |
tree | 0e69b76135ece3baa6f90ddf6cd5c211ac1bfc7c /drivers/hwmon/jc42.c | |
parent | bca6a1ada0464b7179f34f9af62bcdfd60c223e7 (diff) | |
download | blackbird-op-linux-3a05633b042fb4aea65b09ce2d0d43689df6eb9a.tar.gz blackbird-op-linux-3a05633b042fb4aea65b09ce2d0d43689df6eb9a.zip |
hwmon: (jc42) Fix integer overflow
Mixed use of long and int caused an integer overflow when writing large limits.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'drivers/hwmon/jc42.c')
-rw-r--r-- | drivers/hwmon/jc42.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c index 262d8086822f..f8e3bbbf019c 100644 --- a/drivers/hwmon/jc42.c +++ b/drivers/hwmon/jc42.c @@ -201,7 +201,7 @@ struct jc42_data { #define JC42_TEMP_MIN 0 #define JC42_TEMP_MAX 125000 -static u16 jc42_temp_to_reg(int temp, bool extended) +static u16 jc42_temp_to_reg(long temp, bool extended) { int ntemp = clamp_val(temp, extended ? JC42_TEMP_MIN_EXTENDED : |