[Intel-gfx] [PATCH] drm/i915: Skip pixel multiplier x-check if we fail to send the command

Damien Lespiau damien.lespiau at intel.com
Thu Jul 11 20:46:00 CEST 2013


If intel_sdvo_get_value() fails here, val is unitialized and the cross
check won't check anything.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 drivers/gpu/drm/i915/intel_sdvo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index b8e1623..4481f6a 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1357,7 +1357,10 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
 	}
 
 	/* Cross check the port pixel multiplier with the sdvo encoder state. */
-	intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, &val, 1);
+	if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT,
+				  &val, 1))
+		return;
+
 	switch (val) {
 	case SDVO_CLOCK_RATE_MULT_1X:
 		encoder_pixel_multiplier = 1;
-- 
1.8.3.1




More information about the Intel-gfx mailing list