[PATCH] aty128fb: Fix array overrun

Fix static array overrun

Coverity Bug 556

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Antonino A. Daplas and committed by Linus Torvalds 8e650987 54243cef

+4 -3
+4 -3
drivers/video/aty/aty128fb.c
··· 1326 unsigned char post_dividers[] = {1,2,4,8,3,6,12}; 1327 u32 output_freq; 1328 u32 vclk; /* in .01 MHz */ 1329 - int i; 1330 u32 n, d; 1331 1332 vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ ··· 1340 /* now, find an acceptable divider */ 1341 for (i = 0; i < sizeof(post_dividers); i++) { 1342 output_freq = post_dividers[i] * vclk; 1343 - if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) 1344 break; 1345 } 1346 1347 /* calculate feedback divider */ 1348 n = c.ref_divider * output_freq; 1349 d = c.ref_clk; 1350 1351 - pll->post_divider = post_dividers[i]; 1352 pll->feedback_divider = round_div(n, d); 1353 pll->vclk = vclk; 1354
··· 1326 unsigned char post_dividers[] = {1,2,4,8,3,6,12}; 1327 u32 output_freq; 1328 u32 vclk; /* in .01 MHz */ 1329 + int i = 0; 1330 u32 n, d; 1331 1332 vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ ··· 1340 /* now, find an acceptable divider */ 1341 for (i = 0; i < sizeof(post_dividers); i++) { 1342 output_freq = post_dividers[i] * vclk; 1343 + if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) { 1344 + pll->post_divider = post_dividers[i]; 1345 break; 1346 + } 1347 } 1348 1349 /* calculate feedback divider */ 1350 n = c.ref_divider * output_freq; 1351 d = c.ref_clk; 1352 1353 pll->feedback_divider = round_div(n, d); 1354 pll->vclk = vclk; 1355