Skip to content

Commit 949291c

Browse files
Tvrtko UrsulinChristianKoenigAMD
authored andcommitted
dma-fence: Fix reference leak on fence merge failure path
Release all fence references if the output dma-fence-array could not be allocated. Signed-off-by: Tvrtko Ursulin <[email protected]> Fixes: 245a4a7 ("dma-buf: generalize dma_fence unwrap & merging v3") Cc: Christian König <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Friedrich Vock <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: <[email protected]> # v6.0+ Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 32c4514 commit 949291c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/dma-buf/dma-fence-unwrap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences,
164164
dma_fence_context_alloc(1),
165165
1, false);
166166
if (!result) {
167+
for (i = 0; i < count; i++)
168+
dma_fence_put(array[i]);
167169
tmp = NULL;
168170
goto return_tmp;
169171
}

0 commit comments

Comments
 (0)