From: Dan Carpenter Date: Tue, 24 Jul 2018 17:11:28 +0000 (+0200) Subject: fbdev: omapfb: off by one in omapfb_register_client() X-Git-Tag: microblaze-v5.0-rc1~57^2~56 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=5ec1ec35b2979b59d0b33381e7c9aac17e159d16;p=linux-2.6-microblaze.git fbdev: omapfb: off by one in omapfb_register_client() The omapfb_register_client[] array has OMAPFB_PLANE_NUM elements so the > should be >= or we are one element beyond the end of the array. Fixes: 8b08cf2b64f5 ("OMAP: add TI OMAP framebuffer driver") Signed-off-by: Dan Carpenter Cc: Imre Deak Signed-off-by: Bartlomiej Zolnierkiewicz --- diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 585f39efcff6..1c75f4806ed3 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -958,7 +958,7 @@ int omapfb_register_client(struct omapfb_notifier_block *omapfb_nb, { int r; - if ((unsigned)omapfb_nb->plane_idx > OMAPFB_PLANE_NUM) + if ((unsigned)omapfb_nb->plane_idx >= OMAPFB_PLANE_NUM) return -EINVAL; if (!notifier_inited) {