summaryrefslogtreecommitdiff
path: root/drivers/hwmon/nct6775.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-18 18:01:11 +0300
committerGuenter Roeck <linux@roeck-us.net>2013-08-11 22:10:39 -0700
commitf58876ac8c73f91c28f7825dee37ad64092eccf7 (patch)
treef2b2828043f24a54cfdb99e891bfdfe909d5d838 /drivers/hwmon/nct6775.c
parentdf612d5fb73d731e51964a6501fed7d465c79e95 (diff)
downloadlwn-f58876ac8c73f91c28f7825dee37ad64092eccf7.tar.gz
lwn-f58876ac8c73f91c28f7825dee37ad64092eccf7.zip
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 <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/nct6775.c')
-rw-r--r--drivers/hwmon/nct6775.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index f0941d78b985..25e2c7bea48c 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;