summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-03-07 19:30:25 +0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-03-23 16:26:56 +0400
commit00037c2e95618c8a598ff41e2fc4d34367b0eb91 (patch)
treecf7ec9d659b0168534035f3dc55569a85d081ffc /drivers
parente3dff585508636c8d2915cc1595e04f16ccd66ba (diff)
downloadlinux-00037c2e95618c8a598ff41e2fc4d34367b0eb91.tar.xz
drm/i915: Error out if we are trying to use VGA with SPLL already in use
Our static analysis tool noticed that 'reg' could be used uninitialized if we are trying to get a PLL to drive VGA and SPLL is already in use (plls->spll_refcoung != 0). In the (error) case above, let's return false to the caller and emit an error. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index bfcc58ffecbb..ebe529372464 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -898,6 +898,9 @@ bool intel_ddi_pll_mode_set(struct drm_crtc *crtc, int clock)
plls->spll_refcount++;
reg = SPLL_CTL;
intel_crtc->ddi_pll_sel = PORT_CLK_SEL_SPLL;
+ } else {
+ DRM_ERROR("SPLL already in use\n");
+ return false;
}
WARN(I915_READ(reg) & SPLL_PLL_ENABLE,