]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
io_uring: ensure '0' is returned on file registration success
authorJens Axboe <axboe@kernel.dk>
Tue, 2 Apr 2024 14:28:04 +0000 (08:28 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:37 +0000 (16:19 +0200)
A previous backport mistakenly removed code that cleared 'ret' to zero,
as the SCM logging was performed. Fix up the return value so we don't
return an errant error on fixed file registration.

Fixes: d909d381c315 ("io_uring: drop any code related to SCM_RIGHTS")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io_uring.c

index a51429c0342e0db0a9c9cce8ae46db594cbc2d6b..ff6c36aec27c58cccdee6c22fe6846f52e6d736f 100644 (file)
@@ -8422,7 +8422,7 @@ static int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg,
        }
 
        io_rsrc_node_switch(ctx, NULL);
-       return ret;
+       return 0;
 out_fput:
        for (i = 0; i < ctx->nr_user_files; i++) {
                file = io_file_from_index(ctx, i);