drm/i915/sdvo: Don't write stack garbage into the hbuf
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 9 Apr 2019 14:40:53 +0000 (17:40 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 7 Jun 2019 17:41:27 +0000 (20:41 +0300)
Pass the length returned by hdmi_infoframe_pack_only() to
intel_sdvo_write_infoframe() so that we don't end up writing
stack garbage into the hbuf.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190409144054.24561-7-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_sdvo.c

index 1c8ad680813c2786f9fa81c76f0eb0144291cc32..6d78fd1656423223ed79bfa8fef82047486c67b9 100644 (file)
@@ -1106,7 +1106,7 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,
 
        return intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF,
                                          SDVO_HBUF_TX_VSYNC,
-                                         sdvo_data, sizeof(sdvo_data));
+                                         sdvo_data, len);
 }
 
 static void intel_sdvo_get_avi_infoframe(struct intel_sdvo *intel_sdvo,