Message ID | 20220610090734.857067-3-hao.xu@linux.dev (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | misc update for openclose and provided buffer | expand |
diff --git a/io_uring/openclose.c b/io_uring/openclose.c index b35bf5f66dd9..4eb1f23e028a 100644 --- a/io_uring/openclose.c +++ b/io_uring/openclose.c @@ -248,7 +248,7 @@ int io_close(struct io_kiocb *req, unsigned int issue_flags) struct io_close *close = io_kiocb_to_cmd(req); struct fdtable *fdt; struct file *file; - int ret = -EBADF; + int ret; if (close->file_slot) { ret = io_close_fixed(req, issue_flags); @@ -256,6 +256,7 @@ int io_close(struct io_kiocb *req, unsigned int issue_flags) goto err; } + ret = -EBADF; spin_lock(&files->file_lock); fdt = files_fdtable(files); if (close->fd >= fdt->max_fds) {