[Intel-gfx] [PATCH 13/15] drm/i915: Add a sanity check for 'hdmi_default_entry'

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Tue Dec 8 09:59:48 PST 2015


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index c47f45c0f4a2..8d8f346a9615 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -526,6 +526,9 @@ static void intel_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder)
 		hdmi_default_entry = 7;
 	}
 
+	if (WARN_ON(hdmi_default_entry >= n_hdmi_entries))
+		hdmi_default_entry = 0;
+
 	/* Choose a good default if VBT is badly populated */
 	if (hdmi_level == HDMI_LEVEL_SHIFT_UNKNOWN ||
 	    hdmi_level >= n_hdmi_entries)
-- 
2.4.10



More information about the Intel-gfx mailing list