From: Ville Syrjälä <ville.syrj...@linux.intel.com>

Clean up properly if we can't map the DSB buffer.

Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dsb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c 
b/drivers/gpu/drm/i915/display/intel_dsb.c
index 8b357b35c41f..a46a8f499e0e 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.c
+++ b/drivers/gpu/drm/i915/display/intel_dsb.c
@@ -127,6 +127,9 @@ intel_dsb_get(struct intel_crtc *crtc)
        buf = i915_gem_object_pin_map(vma->obj, I915_MAP_WC);
        if (IS_ERR(buf)) {
                DRM_ERROR("Command buffer creation failed\n");
+               i915_vma_unpin(vma);
+               i915_vma_close(vma);
+               i915_gem_object_put(obj);
                goto out;
        }
 
-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to