Skip to content

Commit 0ec33c8

Browse files
isilenceaxboe
authored andcommitted
io_uring/zcrx: fix area release on registration failure
On area registration failure there might be no ifq set and it's not safe to access area->ifq in the release path without checking it first. Cc: [email protected] Fixes: f12ecf5 ("io_uring/zcrx: fix late dma unmap for a dead dev") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/bc02878678a5fec28bc77d33355cdba735418484.1748365640.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent eda4623 commit 0ec33c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

io_uring/zcrx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ static void io_free_rbuf_ring(struct io_zcrx_ifq *ifq)
366366

367367
static void io_zcrx_free_area(struct io_zcrx_area *area)
368368
{
369-
io_zcrx_unmap_area(area->ifq, area);
369+
if (area->ifq)
370+
io_zcrx_unmap_area(area->ifq, area);
370371
io_release_area_mem(&area->mem);
371372

372373
kvfree(area->freelist);

0 commit comments

Comments
 (0)