Skip to content

Commit

Permalink
dma-buf: add WARN_ON() illegal dma-fence signaling
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Simona Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ChristianKoenigAMD committed Oct 9, 2024
1 parent 4cce137 commit 967d226
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dma-buf/dma-fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 967d226

Please sign in to comment.