drm/i915: Fix oops in overlay due to frontbuffer tracking
authorVille Syrjälä <[email protected]>
Wed, 7 Dec 2016 17:28:03 +0000 (19:28 +0200)
committerJani Nikula <[email protected]>
Tue, 3 Jan 2017 09:41:28 +0000 (11:41 +0200)
The vma will be NULL if the overlay was previously off, so
dereferencing it will oops. Check for NULL before doing that.

Cc: [email protected]
Cc: Chris Wilson <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Fixes: 9b3b7841b86d ("drm/i915/overlay: Use VMA as the primary tracker for images")
Signed-off-by: Ville Syrjälä <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Chris Wilson <[email protected]>
(cherry picked from commit 4a15cdbbc55463e55a7cdcf33f84ccc742ca9c29)
Signed-off-by: Jani Nikula <[email protected]>
drivers/gpu/drm/i915/intel_overlay.c

index 57ef9c88843cbfd3c8e9c9a37c65a952057cd08d..e589e17876dc134b60bbb5958ad1fe856f2f118e 100644 (file)
@@ -840,8 +840,8 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
        if (ret)
                goto out_unpin;
 
-       i915_gem_track_fb(overlay->vma->obj, new_bo,
-                         INTEL_FRONTBUFFER_OVERLAY(pipe));
+       i915_gem_track_fb(overlay->vma ? overlay->vma->obj : NULL,
+                         vma->obj, INTEL_FRONTBUFFER_OVERLAY(pipe));
 
        overlay->old_vma = overlay->vma;
        overlay->vma = vma;