The failure of create debugfs of VM will return directly without release
the anon file. It will leak memory and file descriptors, even through
be not serious.
Signed-off-by: Liu Shuo <shuo.a.liu@intel.com>
Fixes:
536a6f88c49dd739961ffd53774775afed852c83
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
#include <linux/slab.h>
#include <linux/sort.h>
#include <linux/bsearch.h>
+#include <linux/syscalls.h>
#include <asm/processor.h>
#include <asm/io.h>
if (kvm_create_vm_debugfs(kvm, r) < 0) {
kvm_put_kvm(kvm);
+ sys_close(r);
return -ENOMEM;
}