]> git.sur5r.net Git - groeck-nct6775/commitdiff
hwmon: (nct6775) Fix temp array overflow
authorGuenter Roeck <linux@roeck-us.net>
Tue, 24 Jul 2012 03:57:16 +0000 (20:57 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 24 Jul 2012 03:59:39 +0000 (20:59 -0700)
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 <linux@roeck-us.net>
nct6775.c

index 3592371ac247bdd95e3ce8e46fed884dea79e141..321308538c04f3ff4c5f3b3e424645cd3565256c 100644 (file)
--- 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 */