mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
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>
This commit is contained in:
parent
3123109284
commit
4329490a78
@ -10961,14 +10961,14 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
|
||||
return -EINVAL;
|
||||
fd = array_index_nospec(fd, IO_RINGFD_REG_MAX);
|
||||
f.file = tctx->registered_rings[fd];
|
||||
if (unlikely(!f.file))
|
||||
return -EBADF;
|
||||
f.flags = 0;
|
||||
} else {
|
||||
f = fdget(fd);
|
||||
if (unlikely(!f.file))
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
if (unlikely(!f.file))
|
||||
return -EBADF;
|
||||
|
||||
ret = -EOPNOTSUPP;
|
||||
if (unlikely(f.file->f_op != &io_uring_fops))
|
||||
goto out_fput;
|
||||
@ -11041,8 +11041,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
|
||||
out:
|
||||
percpu_ref_put(&ctx->refs);
|
||||
out_fput:
|
||||
if (!(flags & IORING_ENTER_REGISTERED_RING))
|
||||
fdput(f);
|
||||
fdput(f);
|
||||
return submitted ? submitted : ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user