Commit fc9375e3 authored by Pavel Begunkov's avatar Pavel Begunkov

io_uring: fix double unlock for pbuf select

io_buffer_select(), which is the only caller of io_ring_buffer_select(),
fully handles locking, mutex unlock in io_ring_buffer_select() will lead
to double unlock.

Fixes: c7fb1942 ("io_uring: add support for ring mapped supplied buffers")
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
parent 42db0c00
......@@ -3849,10 +3849,8 @@ static void __user *io_ring_buffer_select(struct io_kiocb *req, size_t *len,
struct io_uring_buf *buf;
__u32 head = bl->head;
if (unlikely(smp_load_acquire(&br->tail) == head)) {
io_ring_submit_unlock(req->ctx, issue_flags);
if (unlikely(smp_load_acquire(&br->tail) == head))
return NULL;
}
head &= bl->mask;
if (head < IO_BUFFER_LIST_BUF_PER_PAGE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment