Skip to content

Commit

Permalink
fbdev: omapfb: off by one in omapfb_register_client()
Browse files Browse the repository at this point in the history
[ Upstream commit 5ec1ec3 ]

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: 8b08cf2 ("OMAP: add TI OMAP framebuffer driver")
Signed-off-by: Dan Carpenter <[email protected]>
Cc: Imre Deak <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dan Carpenter authored and gregkh committed Sep 26, 2018
1 parent 3340ab9 commit 3bc6deb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/fbdev/omap/omapfb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3bc6deb

Please sign in to comment.