All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] dme1737: Keep index within pwm_config[]
@ 2009-07-23 17:34 Roel Kluin
  2009-07-24  7:12 ` Jean Delvare
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Roel Kluin @ 2009-07-23 17:34 UTC (permalink / raw)
  To: lm-sensors

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-25  8:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 17:34 [lm-sensors] [PATCH] dme1737: Keep index within pwm_config[] Roel Kluin
2009-07-24  7:12 ` Jean Delvare
2009-07-24 23:53 ` Andrew Morton
2009-07-25  6:41 ` Jean Delvare
2009-07-25  8:18 ` Roel Kluin

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.