io_uring_enter(): don't leave f.flags uninitialized

simplifies logics on cleanup, as well...

Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 4329490a 31231092

+5 -6
+5 -6
fs/io_uring.c
··· 10961 10961 return -EINVAL; 10962 10962 fd = array_index_nospec(fd, IO_RINGFD_REG_MAX); 10963 10963 f.file = tctx->registered_rings[fd]; 10964 - if (unlikely(!f.file)) 10965 - return -EBADF; 10964 + f.flags = 0; 10966 10965 } else { 10967 10966 f = fdget(fd); 10968 - if (unlikely(!f.file)) 10969 - return -EBADF; 10970 10967 } 10968 + 10969 + if (unlikely(!f.file)) 10970 + return -EBADF; 10971 10971 10972 10972 ret = -EOPNOTSUPP; 10973 10973 if (unlikely(f.file->f_op != &io_uring_fops)) ··· 11041 11041 out: 11042 11042 percpu_ref_put(&ctx->refs); 11043 11043 out_fput: 11044 - if (!(flags & IORING_ENTER_REGISTERED_RING)) 11045 - fdput(f); 11044 + fdput(f); 11046 11045 return submitted ? submitted : ret; 11047 11046 } 11048 11047