mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 11:21:26 -04:00
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>
This commit is contained in:
committed by
Jens Axboe
parent
8ae2837d5a
commit
52dcd1776b
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user