提交 2f28c50b 编写于 作者: D Damien Lespiau 提交者: Daniel Vetter

drm/i915: Initialize active_outputs to never read unitialized values

In case of intel_sdvo_get_active_outputs() failing, we end up reading a
value from the stack.
Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 19d415a2
...@@ -1277,7 +1277,7 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector) ...@@ -1277,7 +1277,7 @@ static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)
struct intel_sdvo_connector *intel_sdvo_connector = struct intel_sdvo_connector *intel_sdvo_connector =
to_intel_sdvo_connector(&connector->base); to_intel_sdvo_connector(&connector->base);
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base); struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base);
u16 active_outputs; u16 active_outputs = 0;
intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs);
...@@ -1293,7 +1293,7 @@ static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder, ...@@ -1293,7 +1293,7 @@ static bool intel_sdvo_get_hw_state(struct intel_encoder *encoder,
struct drm_device *dev = encoder->base.dev; struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
u16 active_outputs; u16 active_outputs = 0;
u32 tmp; u32 tmp;
tmp = I915_READ(intel_sdvo->sdvo_reg); tmp = I915_READ(intel_sdvo->sdvo_reg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册