From 3a05633b042fb4aea65b09ce2d0d43689df6eb9a Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 18 Jan 2015 17:29:32 -0800 Subject: hwmon: (jc42) Fix integer overflow Mixed use of long and int caused an integer overflow when writing large limits. Signed-off-by: Guenter Roeck Reviewed-by: Jean Delvare --- drivers/hwmon/jc42.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/hwmon') 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 : -- cgit v1.2.3