Skip to content

Commit 967d226

Browse files
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 <[email protected]> Reviewed-by: Simona Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4cce137 commit 967d226

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/dma-buf/dma-fence.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp)
412412
unsigned long flags;
413413
int ret;
414414

415-
if (!fence)
415+
if (WARN_ON(!fence))
416416
return -EINVAL;
417417

418418
spin_lock_irqsave(fence->lock, flags);
@@ -464,7 +464,7 @@ int dma_fence_signal(struct dma_fence *fence)
464464
int ret;
465465
bool tmp;
466466

467-
if (!fence)
467+
if (WARN_ON(!fence))
468468
return -EINVAL;
469469

470470
tmp = dma_fence_begin_signalling();

0 commit comments

Comments
 (0)