diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2026-04-01 00:07:41 +0300 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-04-02 15:55:36 +0300 |
| commit | 52dcd1776bed614c6a270d9237df6105feab4c14 (patch) | |
| tree | 0736fb31f23b661d7e4f3e366447b09edaf888a2 | |
| parent | 8ae2837d5a97644b729a889951127da98111a32d (diff) | |
| download | linux-52dcd1776bed614c6a270d9237df6105feab4c14.tar.xz | |
io_uring/zcrx: don't clear not allocated niovs
Now that area->is_mapped is set earlier before niovs array is allocated,
io_zcrx_free_area -> io_zcrx_unmap_area in an error path can try to
clear dma addresses for unallocated niovs, fix it.
Fixes: 8c0cab0b7bf7 ("io_uring/zcrx: always dma map in advance")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/cbcb7749b5a001ecd4d1c303515ce9403215640c.1774780198.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | io_uring/zcrx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 5c0a49340722..d84ad40eae49 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -289,8 +289,10 @@ static void io_zcrx_unmap_area(struct io_zcrx_ifq *ifq, return; area->is_mapped = false; - for (i = 0; i < area->nia.num_niovs; i++) - net_mp_niov_set_dma_addr(&area->nia.niovs[i], 0); + if (area->nia.niovs) { + for (i = 0; i < area->nia.num_niovs; i++) + net_mp_niov_set_dma_addr(&area->nia.niovs[i], 0); + } if (area->mem.is_dmabuf) { io_release_dmabuf(&area->mem); |
