diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-01-18 20:29:32 -0500 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2015-01-26 00:23:59 -0500 |
commit | 3a05633b042fb4aea65b09ce2d0d43689df6eb9a (patch) | |
tree | 0e69b76135ece3baa6f90ddf6cd5c211ac1bfc7c /drivers/hwmon | |
parent | bca6a1ada0464b7179f34f9af62bcdfd60c223e7 (diff) |
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')
-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 { | |||
201 | #define JC42_TEMP_MIN 0 | 201 | #define JC42_TEMP_MIN 0 |
202 | #define JC42_TEMP_MAX 125000 | 202 | #define JC42_TEMP_MAX 125000 |
203 | 203 | ||
204 | static u16 jc42_temp_to_reg(int temp, bool extended) | 204 | static u16 jc42_temp_to_reg(long temp, bool extended) |
205 | { | 205 | { |
206 | int ntemp = clamp_val(temp, | 206 | int ntemp = clamp_val(temp, |
207 | extended ? JC42_TEMP_MIN_EXTENDED : | 207 | extended ? JC42_TEMP_MIN_EXTENDED : |