Skip to contentSkip to conversation

drm: Skip too big EDID extensions

PATCH New Takashi Iwai 1 participant 1 message Jun 5, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Skip too big EDID extensions

When the number of extension blocks in EDID is too big, it's more likely a broken data, thus better to skip them.

We've got a bug report that a machine spews "invalid block EDID" errors at boot for 400 times which delays the boot very much, and this patch fixes it. Certainly it's a hardware-specific problem, but it's anyway safer to avoid such almost unrealistic setups.

---
 drivers/gpu/drm/drm_edid.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/drm_edid.c +7 -0
index eb92fe2..61e4cf1 100644
@@ -321,6 +321,13 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
 	if (i == 4)
 		goto carp;
 
+	if (block[0x7e] > 20) {
+		/* too many extensions -- something is wrong */
+		DRM_DEBUG_KMS("drm: %s: ignoring too many extensions %d\n",
+			      adapter->name, block[0x7e]);
+		block[0x7e] = 0;
+	}
+
 	/* if there's no extensions, we're done */
 	if (block[0x7e] == 0)
 		return block;
Signature · 1 line
1.7.10.3