Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fee280d3 authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Dave Airlie
Browse files

drm/ttm: Fix a sync object leak.



If there are multiple simultaneous waiters for the same buffer object,
a temporary reference to its sync object may be leaked.

Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent c9b7fb54
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1575,6 +1575,10 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
			driver->sync_obj_unref(&sync_obj);
			driver->sync_obj_unref(&tmp_obj);
			spin_lock(&bo->lock);
		} else {
			spin_unlock(&bo->lock);
			driver->sync_obj_unref(&sync_obj);
			spin_lock(&bo->lock);
		}
	}
	return 0;