Skip to content

Commit 3cc3dd7

Browse files
dma-buf: fix dma_fence_default_wait() signaling check
That check must now come after grabing the spinlock, not before. Signed-off-by: Christian König <[email protected]> Fixes: b96fb1e ("dma-buf: dma_fence_wait must enable signaling") Acked-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ed712d3 commit 3cc3dd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/dma-buf/dma-fence.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,11 +763,11 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout)
763763
unsigned long flags;
764764
signed long ret = timeout ? timeout : 1;
765765

766-
if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
767-
return ret;
768-
769766
spin_lock_irqsave(fence->lock, flags);
770767

768+
if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
769+
goto out;
770+
771771
if (intr && signal_pending(current)) {
772772
ret = -ERESTARTSYS;
773773
goto out;

0 commit comments

Comments
 (0)