If kbuf expands the iovec array, then it doesn't matter if the caller didn't set KBUF_MODE_FREE or not, as once allocated it should be marked as such. Ensure that this is the case. Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> --- io_uring/kbuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index d407576ddfb7..1318b8ee2599 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -245,6 +245,7 @@ static int io_ring_buffers_peek(struct io_kiocb *req, struct buf_sel_arg *arg, kfree(arg->iovs); arg->iovs = iov; nr_iovs = nr_avail; + arg->mode |= KBUF_MODE_FREE; } else if (nr_avail < nr_iovs) { nr_iovs = nr_avail; } -- 2.45.2