From: Ville Syrjälä <[email protected]>

Before we go writing the infoframe let's make sure we have
the space for it. Not that it really matters since the write
loop would just terminate early in that case.

Signed-off-by: Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/intel_sdvo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c 
b/drivers/gpu/drm/i915/intel_sdvo.c
index 7f64352a3413..1e0102f1710f 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -970,6 +970,9 @@ static bool intel_sdvo_write_infoframe(struct intel_sdvo 
*intel_sdvo,
                                  &hbuf_size, 1))
                return false;
 
+       if (hbuf_size < length)
+               return false;
+
        /* Buffer size is 0 based, hooray! */
        hbuf_size++;
 
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to