Skip to content

Commit

Permalink
hwmon: (jc42) Fix integer overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guenter Roeck committed Jan 26, 2015
1 parent bca6a1a commit 3a05633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/jc42.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down

0 comments on commit 3a05633

Please sign in to comment.