[Intel-gfx] [PATCH 5/9] drm/i915/dsb: Unwind on map error

Ville Syrjala ville.syrjala at linux.intel.com
Wed Jan 29 18:20:30 UTC 2020


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

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

Signed-off-by: Ville Syrjälä <ville.syrjala at 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



More information about the Intel-gfx mailing list