commit | 506cfba9e726ab6842883fdd567a9a7c467e7492 | [log] [tgz] |
---|---|---|
author | Al Viro <viro@ZenIV.linux.org.uk> | Thu Jul 14 18:54:17 2016 +0200 |
committer | Paolo Bonzini <pbonzini@redhat.com> | Thu Jul 14 19:11:22 2016 +0200 |
tree | 7f6f26ce5413b63c066fe974231be881841e8ffa | |
parent | 7964218c7d8fe36a79a5e02312b1f3a16a17ee68 [diff] |
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: Paolo Bonzini <pbonzini@redhat.com>