From: Dan Carpenter Date: Thu, 18 Jul 2013 15:01:11 +0000 (+0300) Subject: hwmon: (nct6775) Fix size of data->temp array X-Git-Tag: next-20130802~76^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2921d10fa072fe683a68ec3bc1b12438bef2b57d;p=karo-tx-linux.git hwmon: (nct6775) Fix size of data->temp array Smatch complains that we have a array overflow: drivers/hwmon/nct6775.c:1456 nct6775_update_device() error: buffer overflow 'data->temp' 4 <= 4 Guenter Roeck says that the array should have been made larger in 7cbbd6aee6 (Add support for critical low/high temperature limits on NCT6106). This patch does that. Signed-off-by: Dan Carpenter Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index ba3dab513c74..8dd01cbcc7b1 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c @@ -813,8 +813,8 @@ struct nct6775_data { u8 temp_fixed_num; /* 3 or 6 */ u8 temp_type[NUM_TEMP_FIXED]; s8 temp_offset[NUM_TEMP_FIXED]; - s16 temp[4][NUM_TEMP]; /* 0=temp, 1=temp_over, 2=temp_hyst, - * 3=temp_crit */ + s16 temp[5][NUM_TEMP]; /* 0=temp, 1=temp_over, 2=temp_hyst, + * 3=temp_crit, 4=temp_lcrit */ u64 alarms; u64 beeps;