Re: [2.6.37-rc7] drivers/gpu/drm/drm_edid.c:1303: warning: array subscript is above array bounds

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jarek Poplawski
Date: Saturday, December 25, 2010 - 12:20 pm

On Sat, Dec 25, 2010 at 01:38:56PM +0000, Chris Wilson wrote:

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;
 	}
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [2.6.37-rc7] drivers/gpu/drm/drm_edid.c:1303: warning: ..., Jarek Poplawski, (Sat Dec 25, 12:20 pm)