diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index bea3e9858aca..ce9e6c04897f 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -790,8 +790,11 @@ static int __init dma_resv_lockdep(void) mmap_read_lock(mm); ww_acquire_init(&ctx, &reservation_ww_class); ret = dma_resv_lock(&obj, &ctx); - if (ret == -EDEADLK) + if (ret) { + /* Only EDEADLK from the error injection is possible here */ + WARN_ON(ret != -EDEADLK); dma_resv_lock_slow(&obj, &ctx); + } fs_reclaim_acquire(GFP_KERNEL); /* for unmap_mapping_range on trylocked buffer objects in shrinkers */ i_mmap_lock_write(&mapping);