diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-14 12:49:52 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-14 13:11:21 -0400 |
commit | 7964218c7d8fe36a79a5e02312b1f3a16a17ee68 (patch) | |
tree | 8fead675d92c2fbdc180db2231fd47e6ff067984 /virt/kvm | |
parent | 2be5b3f6dc84d30810cc0a94fa66205c27cf5f42 (diff) |
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 <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/kvm_main.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index cc182d9760ed..dd25346ec356 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -49,7 +49,6 @@ | |||
49 | #include <linux/slab.h> | 49 | #include <linux/slab.h> |
50 | #include <linux/sort.h> | 50 | #include <linux/sort.h> |
51 | #include <linux/bsearch.h> | 51 | #include <linux/bsearch.h> |
52 | #include <linux/syscalls.h> | ||
53 | 52 | ||
54 | #include <asm/processor.h> | 53 | #include <asm/processor.h> |
55 | #include <asm/io.h> | 54 | #include <asm/io.h> |
@@ -3070,7 +3069,6 @@ static int kvm_dev_ioctl_create_vm(unsigned long type) | |||
3070 | 3069 | ||
3071 | if (kvm_create_vm_debugfs(kvm, r) < 0) { | 3070 | if (kvm_create_vm_debugfs(kvm, r) < 0) { |
3072 | kvm_put_kvm(kvm); | 3071 | kvm_put_kvm(kvm); |
3073 | sys_close(r); | ||
3074 | return -ENOMEM; | 3072 | return -ENOMEM; |
3075 | } | 3073 | } |
3076 | 3074 | ||