Skip to content
Snippets Groups Projects
Commit 49c66df5 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by T.J. Mercier
Browse files

UPSTREAM: dma-fence: Fix reference leak on fence merge failure path


Release all fence references if the output dma-fence-array could not be
allocated.

Change-Id: I9d60f6f8b37e15926a40038b0278b70f4653ce51
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: 245a4a7b ("dma-buf: generalize dma_fence unwrap & merging v3")
Cc: Christian König <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Friedrich Vock <friedrich.vock@gmx.de>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: <stable@vger.kernel.org> # v6.0+
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241115102153.1980-2-tursulin@igalia.com


(cherry picked from commit 949291c5)
Bug: 394776841
Bug: 397845301
Signed-off-by: default avatarT.J. Mercier <tjmercier@google.com>
parent 18d1cf5d
No related branches found
No related tags found
No related merge requests found
......@@ -169,6 +169,8 @@ struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences,
dma_fence_context_alloc(1),
1, false);
if (!result) {
for (i = 0; i < count; i++)
dma_fence_put(array[i]);
tmp = NULL;
goto return_tmp;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment