diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 03e52094630a..bb6492b66751 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -442,7 +442,7 @@ static inline bool io_file_can_poll(struct io_kiocb *req) { if (req->flags & REQ_F_CAN_POLL) return true; - if (file_can_poll(req->file)) { + if (req->file && file_can_poll(req->file)) { req->flags |= REQ_F_CAN_POLL; return true; }