]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915: Check for a NULL shared dpll before dereferencing
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 28 May 2014 15:16:42 +0000 (16:16 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 3 Jun 2014 14:35:57 +0000 (16:35 +0200)
This doesn't look possible but a little extra defense against the
improbable is worth it - an oops here could lockup the machine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index 883c69a47a99bd1429cb80507c454aa571161f4e..0875992c65ed221dddab19a7a6bca93f9ebce66e 100644 (file)
@@ -1760,6 +1760,9 @@ static void intel_prepare_shared_dpll(struct intel_crtc *crtc)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_shared_dpll *pll = intel_crtc_to_shared_dpll(crtc);
 
+       if (WARN_ON(pll == NULL))
+               return;
+
        WARN_ON(!pll->refcount);
        if (pll->active == 0) {
                DRM_DEBUG_DRIVER("setting up %s\n", pll->name);