]>
Commit | Line | Data |
---|---|---|
47f38bc9 GKH |
1 | From foo@baz Fri Sep 21 09:36:02 CEST 2018 |
2 | From: Dan Carpenter <dan.carpenter@oracle.com> | |
3 | Date: Tue, 24 Jul 2018 19:11:28 +0200 | |
4 | Subject: fbdev: omapfb: off by one in omapfb_register_client() | |
5 | ||
6 | From: Dan Carpenter <dan.carpenter@oracle.com> | |
7 | ||
8 | [ Upstream commit 5ec1ec35b2979b59d0b33381e7c9aac17e159d16 ] | |
9 | ||
10 | The omapfb_register_client[] array has OMAPFB_PLANE_NUM elements so the | |
11 | > should be >= or we are one element beyond the end of the array. | |
12 | ||
13 | Fixes: 8b08cf2b64f5 ("OMAP: add TI OMAP framebuffer driver") | |
14 | Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> | |
15 | Cc: Imre Deak <imre.deak@solidboot.com> | |
16 | Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | |
17 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | --- | |
20 | drivers/video/fbdev/omap/omapfb_main.c | 2 +- | |
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
22 | ||
23 | --- a/drivers/video/fbdev/omap/omapfb_main.c | |
24 | +++ b/drivers/video/fbdev/omap/omapfb_main.c | |
25 | @@ -956,7 +956,7 @@ int omapfb_register_client(struct omapfb | |
26 | { | |
27 | int r; | |
28 | ||
29 | - if ((unsigned)omapfb_nb->plane_idx > OMAPFB_PLANE_NUM) | |
30 | + if ((unsigned)omapfb_nb->plane_idx >= OMAPFB_PLANE_NUM) | |
31 | return -EINVAL; | |
32 | ||
33 | if (!notifier_inited) { |