Skip to content
Commit 506cfba9 authored by Al Viro's avatar Al Viro Committed by Paolo Bonzini
Browse files

KVM: don't use anon_inode_getfd() before possible failures



Once anon_inode_getfd() has succeeded, it's impossible to undo
in a clean way and no, sys_close() is not usable in such cases.
Use anon_inode_getfile() and get_unused_fd_flags() to get struct file
and descriptor and do *not* install the file into the descriptor table
until after the last possible failure exit.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 7964218c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment