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: c7fb19428d ("io_uring: add support for ring mapped supplied buffers")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
This commit is contained in:
Pavel Begunkov 2022-06-12 14:31:38 +01:00
parent 42db0c00e2
commit fc9375e3f7
1 changed files with 1 additions and 3 deletions

View File

@ -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) {