summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-01-29 04:52:21 +0100
committerJens Axboe <axboe@kernel.dk>2024-02-08 21:27:06 +0100
commit949249e25f1098315a971b70b893c1a2e2e4a819 (patch)
tree04daab1c1e2584b01b3872cbf30ed94ef5f1ba12 /io_uring
parentio_uring: cleanup io_req_complete_post() (diff)
downloadlinux-949249e25f1098315a971b70b893c1a2e2e4a819.tar.xz
linux-949249e25f1098315a971b70b893c1a2e2e4a819.zip
io_uring/rw: remove dead file == NULL check
Any read/write opcode has needs_file == true, which means that we would've failed the request long before reaching the issue stage if we didn't successfully assign a file. This check has been dead forever, and is really a leftover from generic code. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/rw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 0fb7a045163a..8ba93fffc23a 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -721,7 +721,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
struct file *file = req->file;
int ret;
- if (unlikely(!file || !(file->f_mode & mode)))
+ if (unlikely(!(file->f_mode & mode)))
return -EBADF;
if (!(req->flags & REQ_F_FIXED_FILE))