leds: leds-tca6507: off by one in choose_times()

From: Dan Carpenter
Date: Fri Dec 16 2011 - 07:31:41 EST


Hi Neil,

Smatch complains about 7a9244d89523 "leds: add driver for TCA6507 LED
controller"

drivers/leds/leds-tca6507.c +185 choose_times(16)
error: buffer overflow 'time_codes' 16 <= 16

184 for (c1 = 1; c1 <= TIMECODES; c1++) {
185 int t = time_codes[c1];
^^^^^^^^^^^^^
We're reading 1 past the end of the array here.

186 if (t*2 < tmin)
187 continue;

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/