OSDN Git Service

fbdev: omapfb: off by one in omapfb_register_client()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 24 Jul 2018 17:11:28 +0000 (19:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:39:25 +0000 (08:39 +0200)
[ Upstream commit 5ec1ec35b2979b59d0b33381e7c9aac17e159d16 ]

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 <dan.carpenter@oracle.com>
Cc: Imre Deak <imre.deak@solidboot.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/fbdev/omap/omapfb_main.c

index 585f39e..1c75f48 100644 (file)
@@ -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) {