summaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-06-06 02:14:03 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2022-06-06 02:14:03 +0200
commit6684cf42906ff5f44580e16a1f898e89c19aabd5 (patch)
treeb0370221df3a99967a42455610365043deb36d0b /fs/io_uring.c
parentMerge tag 'mm-hotfixes-stable-2022-06-05' of git://git.kernel.org/pub/scm/lin... (diff)
parentfix the breakage in close_fd_get_file() calling conventions change (diff)
downloadlinux-6684cf42906ff5f44580e16a1f898e89c19aabd5.tar.xz
linux-6684cf42906ff5f44580e16a1f898e89c19aabd5.zip
Merge tag 'pull-work.fd-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull file descriptor fix from Al Viro: "Fix for breakage in #work.fd this window" * tag 'pull-work.fd-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix the breakage in close_fd_get_file() calling conventions change
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 86f9df56526b..3aab4182fd89 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6010,7 +6010,7 @@ static int io_close(struct io_kiocb *req, unsigned int issue_flags)
struct files_struct *files = current->files;
struct io_close *close = &req->close;
struct fdtable *fdt;
- struct file *file = NULL;
+ struct file *file;
int ret = -EBADF;
if (req->close.file_slot) {
@@ -6029,7 +6029,6 @@ static int io_close(struct io_kiocb *req, unsigned int issue_flags)
lockdep_is_held(&files->file_lock));
if (!file || file->f_op == &io_uring_fops) {
spin_unlock(&files->file_lock);
- file = NULL;
goto err;
}
@@ -6049,8 +6048,6 @@ static int io_close(struct io_kiocb *req, unsigned int issue_flags)
err:
if (ret < 0)
req_set_fail(req);
- if (file)
- fput(file);
__io_req_complete(req, issue_flags, ret, 0);
return 0;
}