summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_uring/kbuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index 57ef6850c6a8..55902303d7dc 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -154,7 +154,8 @@ static void __user *io_ring_buffer_select(struct io_kiocb *req, size_t *len,
req->buf_list = bl;
req->buf_index = buf->bid;
- if (issue_flags & IO_URING_F_UNLOCKED || !file_can_poll(req->file)) {
+ if (issue_flags & IO_URING_F_UNLOCKED ||
+ (req->file && !file_can_poll(req->file))) {
/*
* If we came in unlocked, we have no choice but to consume the
* buffer here, otherwise nothing ensures that the buffer won't