From: Roel Kluin Date: Tue, 16 Jun 2009 22:34:32 +0000 (-0700) Subject: carminefb: fix possible access beyond end of carmine_modedb[] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=493f139ecf9ee72f73ccbabd016325a145e884ee;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git carminefb: fix possible access beyond end of carmine_modedb[] This check is off-by-one. Signed-off-by: Roel Kluin Cc: Sebastian Siewior Cc: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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 if (ret < 0) goto err_free_fb; - if (fb_mode > ARRAY_SIZE(carmine_modedb)) + if (fb_mode >= ARRAY_SIZE(carmine_modedb)) fb_mode = CARMINEFB_DEFAULT_VIDEO_MODE; par->cur_mode = par->new_mode = ~0;