Skip to content

Commit 7964218

Browse files
committed
Revert "KVM: release anon file in failure path of vm creation"
This reverts commit 77ecc085fed1af1000ca719522977b960aa6da52. Al Viro colorfully says: "You should *NEVER* use sys_close() on failure exit paths like that. Moreover, this kvm_put_kvm() becomes a double-put, since closing the damn file will drop that reference to kvm. Please, revert. anon_inode_getfd() should be used only when there's no possible failures past its call". Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 2be5b3f commit 7964218

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

virt/kvm/kvm_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#include <linux/slab.h>
5050
#include <linux/sort.h>
5151
#include <linux/bsearch.h>
52-
#include <linux/syscalls.h>
5352

5453
#include <asm/processor.h>
5554
#include <asm/io.h>
@@ -3070,7 +3069,6 @@ static int kvm_dev_ioctl_create_vm(unsigned long type)
30703069

30713070
if (kvm_create_vm_debugfs(kvm, r) < 0) {
30723071
kvm_put_kvm(kvm);
3073-
sys_close(r);
30743072
return -ENOMEM;
30753073
}
30763074

0 commit comments

Comments
 (0)