From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch v2] hwmon: (nct6775) make an array larger
Date: Thu, 18 Jul 2013 15:01:11 +0000 [thread overview]
Message-ID: <20130718150111.GA11991@elgon.mountain> (raw)
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>
---
v2: the first version was wrong
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index f0941d7..25e2c7b 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;
next reply other threads:[~2013-07-18 15:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-18 15:01 Dan Carpenter [this message]
2013-07-18 21:26 ` [patch v2] hwmon: (nct6775) make an array larger Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130718150111.GA11991@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).