From 6b4fdc1510363003aa228976270fb1916591aede Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Mon, 23 Jul 2012 20:57:16 -0700 Subject: [PATCH] hwmon: (nct6775) Fix temp array overflow With the addition of tempX_crit, there are four sets of temperature values in the temp[][] array, but it was declared with a size of three. Fix it. Signed-off-by: Guenter Roeck --- nct6775.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nct6775.c b/nct6775.c index 3592371..3213085 100644 --- a/nct6775.c +++ b/nct6775.c @@ -612,7 +612,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[3][NUM_TEMP]; /* 0=temp, 1=temp_over, 2=temp_hyst */ + s16 temp[4][NUM_TEMP]; /* 0=temp, 1=temp_over, 2=temp_hyst, + * 3=temp_crit */ u64 alarms; u8 pwm_num; /* number of pwm */ -- 2.39.2