drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()
authorDan Carpenter <error27@gmail.com>
Tue, 15 Nov 2022 13:15:18 +0000 (16:15 +0300)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 4 Jan 2023 15:20:40 +0000 (23:20 +0800)
Call intel_vgpu_unpin_mm() on this error path.

Fixes: 418741480809 ("drm/i915/gvt: Adding ppgtt to GVT GEM context after shadow pdps settled.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/Y3OQ5tgZIVxyQ/WV@kili
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/scheduler.c

index 9cd8fcbf7cad16085d8405c9fc00b077db5cfbcf..8009239935f7bb2261069d658415f908984e511f 100644 (file)
@@ -695,6 +695,7 @@ intel_vgpu_shadow_mm_pin(struct intel_vgpu_workload *workload)
 
        if (workload->shadow_mm->type != INTEL_GVT_MM_PPGTT ||
            !workload->shadow_mm->ppgtt_mm.shadowed) {
+               intel_vgpu_unpin_mm(workload->shadow_mm);
                gvt_vgpu_err("workload shadow ppgtt isn't ready\n");
                return -EINVAL;
        }