From c810acfa216f8c1fa40b35d32ff53566c47a31b2 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Thu, 15 Apr 2021 17:36:25 +0800 Subject: [PATCH] io_uring: remove extra ->file check mainline inclusion from mainline-5.6-rc1 commit 9250f9ee194dc3dcee28a42a1533fa2cc0edd215 category: feature bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27 CVE: NA --------------------------- It won't ever get into io_prep_rw() when req->file haven't been set in io_req_set_file(), hence remove the check. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: yangerkun Reviewed-by: zhangyi (F) Signed-off-by: Cheng Jian --- fs/io_uring.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 63261cd05831..e21e647ae30a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1857,9 +1857,6 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe, unsigned ioprio; int ret; - if (!req->file) - return -EBADF; - if (S_ISREG(file_inode(req->file)->i_mode)) req->flags |= REQ_F_ISREG; -- GitLab