Skip to content

Commit 34c7797

Browse files
committed
dma-buf: Move dma_buf_vmap() to dynamic locking specification
Move dma_buf_vmap/vunmap() functions to the dynamic locking specification by asserting that the reservation lock is held. Acked-by: Sumit Semwal <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 50f0ddc commit 34c7797

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/dma-buf/dma-buf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,8 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)
14501450
if (WARN_ON(!dmabuf))
14511451
return -EINVAL;
14521452

1453+
dma_resv_assert_held(dmabuf->resv);
1454+
14531455
if (!dmabuf->ops->vmap)
14541456
return -EINVAL;
14551457

@@ -1515,6 +1517,8 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)
15151517
if (WARN_ON(!dmabuf))
15161518
return;
15171519

1520+
dma_resv_assert_held(dmabuf->resv);
1521+
15181522
BUG_ON(iosys_map_is_null(&dmabuf->vmap_ptr));
15191523
BUG_ON(dmabuf->vmapping_counter == 0);
15201524
BUG_ON(!iosys_map_is_equal(&dmabuf->vmap_ptr, map));

0 commit comments

Comments
 (0)