aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-06-16 18:34:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 22:47:59 -0400
commit493f139ecf9ee72f73ccbabd016325a145e884ee (patch)
tree593fee921f62721bf785392ebb6cca04a745954e /drivers/video
parent34308fd4a22b4c24f54951e47d14e6ae5de6e150 (diff)
carminefb: fix possible access beyond end of carmine_modedb[]
This check is off-by-one. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/carminefb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c
index c7ff3c1a266a..0c02f8ec4bf3 100644
--- a/drivers/video/carminefb.c
+++ b/drivers/video/carminefb.c
@@ -562,7 +562,7 @@ static int __devinit alloc_carmine_fb(void __iomem *regs, void __iomem *smem_bas
562 if (ret < 0) 562 if (ret < 0)
563 goto err_free_fb; 563 goto err_free_fb;
564 564
565 if (fb_mode > ARRAY_SIZE(carmine_modedb)) 565 if (fb_mode >= ARRAY_SIZE(carmine_modedb))
566 fb_mode = CARMINEFB_DEFAULT_VIDEO_MODE; 566 fb_mode = CARMINEFB_DEFAULT_VIDEO_MODE;
567 567
568 par->cur_mode = par->new_mode = ~0; 568 par->cur_mode = par->new_mode = ~0;