* [PATCH] drm/kmb: Fix for build errors with Warray-bounds
@ 2022-01-27 19:42 Anitha Chrisanthus
2022-01-27 21:13 ` Kees Cook
0 siblings, 1 reply; 3+ messages in thread
From: Anitha Chrisanthus @ 2022-01-27 19:42 UTC (permalink / raw)
To: dri-devel, anitha.chrisanthus; +Cc: edmund.j.dea, sam, keescook, sfr
This fixes the following build error
drivers/gpu/drm/kmb/kmb_plane.c: In function 'kmb_plane_atomic_disable':
drivers/gpu/drm/kmb/kmb_plane.c:165:34: error: array subscript 3 is
above array bounds of 'struct layer_status[2]' [-Werror=array-bounds]
165 | kmb->plane_status[plane_id].ctrl =
LCD_CTRL_GL2_ENABLE;
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from drivers/gpu/drm/kmb/kmb_plane.c:17:
drivers/gpu/drm/kmb/kmb_drv.h:61:41: note: while referencing
'plane_status'
61 | struct layer_status
plane_status[KMB_MAX_PLANES];
| ^~~~~~~~~~~~
drivers/gpu/drm/kmb/kmb_plane.c:162:34: error: array
subscript 2 is above array bounds of 'struct
layer_status[2]' [-Werror=array-bounds]
162 |
kmb->plane_status[plane_id].ctrl =
LCD_CTRL_GL1_ENABLE;
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from
drivers/gpu/drm/kmb/kmb_plane.c:17:
drivers/gpu/drm/kmb/kmb_drv.h:61:41: note:
while referencing 'plane_status'
61 | struct layer_status
plane_status[KMB_MAX_PLANES];
|
^~~~~~~~~~~~
Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")
Signed-off-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
---
drivers/gpu/drm/kmb/kmb_plane.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/gpu/drm/kmb/kmb_plane.c b/drivers/gpu/drm/kmb/kmb_plane.c
index 00404ba4126d..2735b8eb3537 100644
--- a/drivers/gpu/drm/kmb/kmb_plane.c
+++ b/drivers/gpu/drm/kmb/kmb_plane.c
@@ -158,12 +158,6 @@ static void kmb_plane_atomic_disable(struct drm_plane *plane,
case LAYER_1:
kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
break;
- case LAYER_2:
- kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
- break;
- case LAYER_3:
- kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
- break;
}
kmb->plane_status[plane_id].disable = true;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/kmb: Fix for build errors with Warray-bounds
2022-01-27 19:42 [PATCH] drm/kmb: Fix for build errors with Warray-bounds Anitha Chrisanthus
@ 2022-01-27 21:13 ` Kees Cook
2022-01-27 22:34 ` Chrisanthus, Anitha
0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2022-01-27 21:13 UTC (permalink / raw)
To: Anitha Chrisanthus; +Cc: edmund.j.dea, sam, dri-devel, sfr
On Thu, Jan 27, 2022 at 11:42:27AM -0800, Anitha Chrisanthus wrote:
> This fixes the following build error
>
> drivers/gpu/drm/kmb/kmb_plane.c: In function 'kmb_plane_atomic_disable':
> drivers/gpu/drm/kmb/kmb_plane.c:165:34: error: array subscript 3 is
> above array bounds of 'struct layer_status[2]' [-Werror=array-bounds]
> 165 | kmb->plane_status[plane_id].ctrl =
> LCD_CTRL_GL2_ENABLE;
> | ~~~~~~~~~~~~~~~~~^~~~~~~~~~
> In file included from drivers/gpu/drm/kmb/kmb_plane.c:17:
> drivers/gpu/drm/kmb/kmb_drv.h:61:41: note: while referencing
> 'plane_status'
> 61 | struct layer_status
> plane_status[KMB_MAX_PLANES];
This would be better without the line wrapping (to match the actual
output), but otherwise:
Reviewed-by: Kees Cook <keescook@chromium.org>
> | ^~~~~~~~~~~~
> drivers/gpu/drm/kmb/kmb_plane.c:162:34: error: array
> subscript 2 is above array bounds of 'struct
> layer_status[2]' [-Werror=array-bounds]
> 162 |
> kmb->plane_status[plane_id].ctrl =
> LCD_CTRL_GL1_ENABLE;
> | ~~~~~~~~~~~~~~~~~^~~~~~~~~~
> In file included from
> drivers/gpu/drm/kmb/kmb_plane.c:17:
> drivers/gpu/drm/kmb/kmb_drv.h:61:41: note:
> while referencing 'plane_status'
> 61 | struct layer_status
> plane_status[KMB_MAX_PLANES];
> |
> ^~~~~~~~~~~~
>
> Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")
> Signed-off-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
> ---
> drivers/gpu/drm/kmb/kmb_plane.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/kmb/kmb_plane.c b/drivers/gpu/drm/kmb/kmb_plane.c
> index 00404ba4126d..2735b8eb3537 100644
> --- a/drivers/gpu/drm/kmb/kmb_plane.c
> +++ b/drivers/gpu/drm/kmb/kmb_plane.c
> @@ -158,12 +158,6 @@ static void kmb_plane_atomic_disable(struct drm_plane *plane,
> case LAYER_1:
> kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
> break;
> - case LAYER_2:
> - kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
> - break;
> - case LAYER_3:
> - kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
> - break;
> }
>
> kmb->plane_status[plane_id].disable = true;
> --
> 2.25.1
>
--
Kees Cook
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] drm/kmb: Fix for build errors with Warray-bounds
2022-01-27 21:13 ` Kees Cook
@ 2022-01-27 22:34 ` Chrisanthus, Anitha
0 siblings, 0 replies; 3+ messages in thread
From: Chrisanthus, Anitha @ 2022-01-27 22:34 UTC (permalink / raw)
To: Kees Cook
Cc: sam@ravnborg.org, Dea, Edmund J, dri-devel@lists.freedesktop.org,
sfr@canb.auug.org.au
Thanks. Fixed line wrapping and change is pushed to drm-misc-fixes.
> -----Original Message-----
> From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of Kees
> Cook
> Sent: Thursday, January 27, 2022 1:14 PM
> To: Chrisanthus, Anitha <anitha.chrisanthus@intel.com>
> Cc: Dea, Edmund J <edmund.j.dea@intel.com>; sam@ravnborg.org; dri-
> devel@lists.freedesktop.org; sfr@canb.auug.org.au
> Subject: Re: [PATCH] drm/kmb: Fix for build errors with Warray-bounds
>
> On Thu, Jan 27, 2022 at 11:42:27AM -0800, Anitha Chrisanthus wrote:
> > This fixes the following build error
> >
> > drivers/gpu/drm/kmb/kmb_plane.c: In function 'kmb_plane_atomic_disable':
> > drivers/gpu/drm/kmb/kmb_plane.c:165:34: error: array subscript 3 is
> > above array bounds of 'struct layer_status[2]' [-Werror=array-bounds]
> > 165 | kmb->plane_status[plane_id].ctrl =
> > LCD_CTRL_GL2_ENABLE;
> > | ~~~~~~~~~~~~~~~~~^~~~~~~~~~
> > In file included from drivers/gpu/drm/kmb/kmb_plane.c:17:
> > drivers/gpu/drm/kmb/kmb_drv.h:61:41: note: while referencing
> > 'plane_status'
> > 61 | struct layer_status
> > plane_status[KMB_MAX_PLANES];
>
> This would be better without the line wrapping (to match the actual
> output), but otherwise:
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>
> > | ^~~~~~~~~~~~
> > drivers/gpu/drm/kmb/kmb_plane.c:162:34: error: array
> > subscript 2 is above array bounds of 'struct
> > layer_status[2]' [-Werror=array-bounds]
> > 162 |
> > kmb->plane_status[plane_id].ctrl =
> > LCD_CTRL_GL1_ENABLE;
> > | ~~~~~~~~~~~~~~~~~^~~~~~~~~~
> > In file included from
> > drivers/gpu/drm/kmb/kmb_plane.c:17:
> > drivers/gpu/drm/kmb/kmb_drv.h:61:41: note:
> > while referencing 'plane_status'
> > 61 | struct layer_status
> > plane_status[KMB_MAX_PLANES];
> > |
> > ^~~~~~~~~~~~
> >
> > Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")
> > Signed-off-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
> > ---
> > drivers/gpu/drm/kmb/kmb_plane.c | 6 ------
> > 1 file changed, 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/kmb/kmb_plane.c
> b/drivers/gpu/drm/kmb/kmb_plane.c
> > index 00404ba4126d..2735b8eb3537 100644
> > --- a/drivers/gpu/drm/kmb/kmb_plane.c
> > +++ b/drivers/gpu/drm/kmb/kmb_plane.c
> > @@ -158,12 +158,6 @@ static void kmb_plane_atomic_disable(struct
> drm_plane *plane,
> > case LAYER_1:
> > kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
> > break;
> > - case LAYER_2:
> > - kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
> > - break;
> > - case LAYER_3:
> > - kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
> > - break;
> > }
> >
> > kmb->plane_status[plane_id].disable = true;
> > --
> > 2.25.1
> >
>
> --
> Kees Cook
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-27 22:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-27 19:42 [PATCH] drm/kmb: Fix for build errors with Warray-bounds Anitha Chrisanthus
2022-01-27 21:13 ` Kees Cook
2022-01-27 22:34 ` Chrisanthus, Anitha
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.