From: Christian König Date: Thu, 11 Nov 2021 09:46:46 +0000 (+0100) Subject: dma-buf: make fence mandatory for dma_resv_add_excl_fence v2 X-Git-Tag: v5.17-rc1~173^2~15^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c99907c723c6f3f6cae63201ddfac610be13f997;p=thirdparty%2Fkernel%2Flinux.git dma-buf: make fence mandatory for dma_resv_add_excl_fence v2 Calling dma_resv_add_excl_fence() with the fence as NULL and expecting that that this frees up the fences is simply abuse of the internals of the dma_resv object. v2: drop the fence pruning completely. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211129120659.1815-4-christian.koenig@amd.com --- diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index ff3c0558b3b8f..4deea75c0b9cf 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -305,8 +305,7 @@ void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence) if (old) i = old->shared_count; - if (fence) - dma_fence_get(fence); + dma_fence_get(fence); write_seqcount_begin(&obj->seq); /* write_seqcount_begin provides the necessary memory barrier */