mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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:
@@ -412,7 +412,7 @@ int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!fence)
|
if (WARN_ON(!fence))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
spin_lock_irqsave(fence->lock, flags);
|
spin_lock_irqsave(fence->lock, flags);
|
||||||
@@ -464,7 +464,7 @@ int dma_fence_signal(struct dma_fence *fence)
|
|||||||
int ret;
|
int ret;
|
||||||
bool tmp;
|
bool tmp;
|
||||||
|
|
||||||
if (!fence)
|
if (WARN_ON(!fence))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
tmp = dma_fence_begin_signalling();
|
tmp = dma_fence_begin_signalling();
|
||||||
|
|||||||
Reference in New Issue
Block a user