From: Roel Kluin <roel.kluin@gmail.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] dme1737: Keep index within pwm_config[]
Date: Thu, 23 Jul 2009 17:34:58 +0000 [thread overview]
Message-ID: <4A689F42.4070701@gmail.com> (raw)
pwm_config is only 3 bytes - pwm_config[3] is out of range.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Credits to Parfait and Nathan Keynes,
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index 3df202a..57e8ed4 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -1134,7 +1134,7 @@ static ssize_t show_pwm(struct device *dev, struct device_attribute *attr,
res = PWM_FREQ_FROM_REG(data->pwm_freq[ix]);
break;
case SYS_PWM_ENABLE:
- if (ix > 3) {
+ if (ix >= 3) {
res = 1; /* pwm[5-6] hard-wired to manual mode */
} else {
res = PWM_EN_FROM_REG(data->pwm_config[ix]);
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2009-07-23 17:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 17:34 Roel Kluin [this message]
2009-07-24 7:12 ` [lm-sensors] [PATCH] dme1737: Keep index within pwm_config[] Jean Delvare
2009-07-24 23:53 ` Andrew Morton
2009-07-25 6:41 ` Jean Delvare
2009-07-25 8:18 ` Roel Kluin
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=4A689F42.4070701@gmail.com \
--to=roel.kluin@gmail.com \
--cc=lm-sensors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.