Skip to content

Commit eda4623

Browse files
isilenceaxboe
authored andcommitted
io_uring/zcrx: init id for xa_find
xa_find() interprets id as the lower bound and thus expects it initialised. Reported-by: [email protected] Fixes: 76f1cc9 ("io_uring/zcrx: add support for multiple ifqs") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/faea44ef63131e6968f635e1b6b7ca6056f1f533.1748359655.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 44ed0f3 commit eda4623

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
@@ -630,12 +630,13 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
630630
void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx)
631631
{
632632
struct io_zcrx_ifq *ifq;
633-
unsigned long id;
634633

635634
lockdep_assert_held(&ctx->uring_lock);
636635

637636
while (1) {
638637
scoped_guard(mutex, &ctx->mmap_lock) {
638+
unsigned long id = 0;
639+
639640
ifq = xa_find(&ctx->zcrx_ctxs, &id, ULONG_MAX, XA_PRESENT);
640641
if (ifq)
641642
xa_erase(&ctx->zcrx_ctxs, id);

0 commit comments

Comments
 (0)