diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-22 19:43:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:28 -0400 |
commit | 912e837aef72a3dd263dafc3717d92bbc1211a53 (patch) | |
tree | 7872171305a3518b6536754be0d597885e3d2792 /drivers/hwmon/dme1737.c | |
parent | 54fdade1c3332391948ec43530c02c4794a38172 (diff) |
dme1737: Keep index within pwm_config[]
The static code scanner "Parfait" reported this because pwm_config is
only 3 bytes - pwm_config[3] is out of range.
Since this code path is never called with ix == 3 (the device has no PWM4
output) this doesn't change anything in practice. But to encourage
testing with Parfait, lets make the warning go away...
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/dme1737.c')
-rw-r--r-- | drivers/hwmon/dme1737.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c index 9814d51b3af4..2c2cb1ec94c5 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, | |||
1134 | res = PWM_FREQ_FROM_REG(data->pwm_freq[ix]); | 1134 | res = PWM_FREQ_FROM_REG(data->pwm_freq[ix]); |
1135 | break; | 1135 | break; |
1136 | case SYS_PWM_ENABLE: | 1136 | case SYS_PWM_ENABLE: |
1137 | if (ix > 3) { | 1137 | if (ix >= 3) { |
1138 | res = 1; /* pwm[5-6] hard-wired to manual mode */ | 1138 | res = 1; /* pwm[5-6] hard-wired to manual mode */ |
1139 | } else { | 1139 | } else { |
1140 | res = PWM_EN_FROM_REG(data->pwm_config[ix]); | 1140 | res = PWM_EN_FROM_REG(data->pwm_config[ix]); |