]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Guard error capture against unpinned vma
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 10 Jan 2019 11:15:22 +0000 (11:15 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 10 Jan 2019 13:28:45 +0000 (13:28 +0000)
If we find an incompletely setup vma inside the request/engine at the
time of a hang, it may not have vma->pages initialised, so skip
capturing the object before we iterate over NULL.

Spotted by Matthew in preparation for using unpinned vma to track engine
state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190110111522.11023-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gpu_error.c

index 5533a741abebe4dd982fb5cbe75f57b65206f53c..5eaf586c4d48cfe173990aad6b68362824c17afc 100644 (file)
@@ -1034,7 +1034,7 @@ i915_error_object_create(struct drm_i915_private *i915,
        dma_addr_t dma;
        int ret;
 
-       if (!vma)
+       if (!vma || !vma->pages)
                return NULL;
 
        num_pages = min_t(u64, vma->size, vma->obj->base.size) >> PAGE_SHIFT;