dma-buf: add WARN_ON() illegal dma-fence signaling

Calling the signaling a NULL fence is obviously a coding error in a
driver. Those functions unfortunately just returned silently without
raising a warning.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911085903.1496-2-christian.koenig@amd.com
This commit is contained in:
Christian König 2024-09-05 15:51:54 +02:00
parent 4cce1373c1
commit 967d226eaa

View File

@ -412,7 +412,7 @@ int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp)
unsigned long flags;
int ret;
if (!fence)
if (WARN_ON(!fence))
return -EINVAL;
spin_lock_irqsave(fence->lock, flags);
@ -464,7 +464,7 @@ int dma_fence_signal(struct dma_fence *fence)
int ret;
bool tmp;
if (!fence)
if (WARN_ON(!fence))
return -EINVAL;
tmp = dma_fence_begin_signalling();