summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-01-18 17:29:32 -0800
committerGuenter Roeck <linux@roeck-us.net>2015-01-25 21:23:59 -0800
commit3a05633b042fb4aea65b09ce2d0d43689df6eb9a (patch)
tree0e69b76135ece3baa6f90ddf6cd5c211ac1bfc7c /drivers/hwmon
parentbca6a1ada0464b7179f34f9af62bcdfd60c223e7 (diff)
downloadop-kernel-dev-3a05633b042fb4aea65b09ce2d0d43689df6eb9a.zip
op-kernel-dev-3a05633b042fb4aea65b09ce2d0d43689df6eb9a.tar.gz
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index 262d808..f8e3bbb 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 :
OpenPOWER on IntegriCloud