Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-buf/sync-file: fix logic error in new fence merge code

When the array is empty because everything is signaled we can't use
add_fence() to add something because that would filter the signaled
fence again.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 519f490db07e ("dma-buf/sync-file: fix warning about fence containers")
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220329070001.134180-1-christian.koenig@amd.com

+1 -1
+1 -1
drivers/dma-buf/sync_file.c
··· 262 262 } 263 263 264 264 if (index == 0) 265 - add_fence(fences, &index, dma_fence_get_stub()); 265 + fences[index++] = dma_fence_get_stub(); 266 266 267 267 if (num_fences > index) { 268 268 struct dma_fence **tmp;