* [2.6.37-rc7] drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
@ 2010-12-25 13:13 Jarek Poplawski
2010-12-25 13:38 ` Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Jarek Poplawski @ 2010-12-25 13:13 UTC (permalink / raw)
To: Linux Kernel; +Cc: David Airlie, dri-devel
Hi,
There is this compile warning in Linus' tree (gcc version 4.3.3):
drivers/gpu/drm/drm_edid.c: In function 'drm_detect_hdmi_monitor':
drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
drivers/gpu/drm/drm_edid.c: In function 'drm_detect_monitor_audio':
drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
Cheers,
Jarek P.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6.37-rc7] drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
2010-12-25 13:13 [2.6.37-rc7] drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds Jarek Poplawski
@ 2010-12-25 13:38 ` Chris Wilson
2010-12-25 19:20 ` Jarek Poplawski
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2010-12-25 13:38 UTC (permalink / raw)
To: Jarek Poplawski, Linux Kernel; +Cc: dri-devel
On Sat, 25 Dec 2010 14:13:43 +0100, Jarek Poplawski <jarkao2@gmail.com> wrote:
> Hi,
> There is this compile warning in Linus' tree (gcc version 4.3.3):
>
> drivers/gpu/drm/drm_edid.c: In function 'drm_detect_hdmi_monitor':
> drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
> drivers/gpu/drm/drm_edid.c: In function 'drm_detect_monitor_audio':
> drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
What array? It's declared as "u8 *edid_ext;". At first glance looks like a
compiler bug, applying subscript testing to an object with unknown bounds.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6.37-rc7] drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
2010-12-25 13:38 ` Chris Wilson
@ 2010-12-25 19:20 ` Jarek Poplawski
0 siblings, 0 replies; 3+ messages in thread
From: Jarek Poplawski @ 2010-12-25 19:20 UTC (permalink / raw)
To: Chris Wilson; +Cc: Linux Kernel, David Airlie, dri-devel
On Sat, Dec 25, 2010 at 01:38:56PM +0000, Chris Wilson wrote:
> On Sat, 25 Dec 2010 14:13:43 +0100, Jarek Poplawski <jarkao2@gmail.com> wrote:
> > Hi,
> > There is this compile warning in Linus' tree (gcc version 4.3.3):
> >
> > drivers/gpu/drm/drm_edid.c: In function 'drm_detect_hdmi_monitor':
> > drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
> > drivers/gpu/drm/drm_edid.c: In function 'drm_detect_monitor_audio':
> > drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds
>
> What array? It's declared as "u8 *edid_ext;". At first glance looks like a
> compiler bug, applying subscript testing to an object with unknown bounds.
Maybe a bug but then also something very unique in this place wrt the
rest of the kernel (at least in my config). Btw, a patch below removes
this warning.
Jarek P.
--- drm_edid.c- 2010-12-25 19:24:55.000000000 +0100
+++ drm_edid.c 2010-12-25 19:51:45.000000000 +0100
@@ -1290,7 +1290,7 @@ add_detailed_modes(struct drm_connector
*/
static u8 *drm_find_cea_extension(struct edid *edid)
{
- u8 *edid_ext = NULL;
+ char *edid_ext = NULL;
int i;
/* No EDID or EDID extensions */
@@ -1299,7 +1299,7 @@ static u8 *drm_find_cea_extension(struct
/* Find CEA extension */
for (i = 0; i < edid->extensions; i++) {
- edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
+ edid_ext = (char *)edid + EDID_LENGTH * (i + 1);
if (edid_ext[0] == CEA_EXT)
break;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-25 19:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-25 13:13 [2.6.37-rc7] drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds Jarek Poplawski
2010-12-25 13:38 ` Chris Wilson
2010-12-25 19:20 ` Jarek Poplawski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).