Skip to content

Commit 6c3e895

Browse files
isilenceaxboe
authored andcommitted
io_uring/net: fix cleanup after recycle
Don't access io_async_msghdr io_netmsg_recycle(), it may be reallocated. Cc: [email protected] Fixes: 9bb6690 ("io_uring: support multishot in recvmsg") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/9e326f4ad4046ddadf15bf34bf3fa58c6372f6b5.1671461985.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 990a4de commit 6c3e895

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,10 +820,10 @@ int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
820820
goto retry_multishot;
821821

822822
if (mshot_finished) {
823-
io_netmsg_recycle(req, issue_flags);
824823
/* fast path, check for non-NULL to avoid function call */
825824
if (kmsg->free_iov)
826825
kfree(kmsg->free_iov);
826+
io_netmsg_recycle(req, issue_flags);
827827
req->flags &= ~REQ_F_NEED_CLEANUP;
828828
}
829829

0 commit comments

Comments
 (0)