6.12-stable review patch. If anyone has any objections, please let me know.
------------------ From: Tvrtko Ursulin <tvrtko.ursu...@igalia.com> commit 949291c5314009b4f6e252391edbb40fdd5d5414 upstream. Release all fence references if the output dma-fence-array could not be allocated. Signed-off-by: Tvrtko Ursulin <tvrtko.ursu...@igalia.com> Fixes: 245a4a7b531c ("dma-buf: generalize dma_fence unwrap & merging v3") Cc: Christian König <christian.koe...@amd.com> Cc: Daniel Vetter <daniel.vet...@ffwll.ch> Cc: Sumit Semwal <sumit.sem...@linaro.org> Cc: Gustavo Padovan <gust...@padovan.org> Cc: Friedrich Vock <friedrich.v...@gmx.de> Cc: linux-me...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-...@lists.linaro.org Cc: <sta...@vger.kernel.org> # v6.0+ Reviewed-by: Christian König <christian.koe...@amd.com> Signed-off-by: Christian König <christian.koe...@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241115102153.1980-2-tursu...@igalia.com Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> --- drivers/dma-buf/dma-fence-unwrap.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/dma-buf/dma-fence-unwrap.c +++ b/drivers/dma-buf/dma-fence-unwrap.c @@ -164,6 +164,8 @@ restart: 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; }