aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/io_uring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index f730af32c17a..cd9c4c05f6f5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8112,12 +8112,13 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
err = -EBADF;
break;
}
+ *file_slot = file;
err = io_sqe_file_register(ctx, file, i);
if (err) {
+ *file_slot = NULL;
fput(file);
break;
}
- *file_slot = file;
}
}