linux/arch/mips/kvm
Deng-Cheng Zhu c42ce86f16 MIPS: KVM: Fix memory leak on VCPU
commit 8c9eb041cf upstream.

kvm_arch_vcpu_free() is called in 2 code paths:

1) kvm_vm_ioctl()
       kvm_vm_ioctl_create_vcpu()
           kvm_arch_vcpu_destroy()
               kvm_arch_vcpu_free()
2) kvm_put_kvm()
       kvm_destroy_vm()
           kvm_arch_destroy_vm()
               kvm_mips_free_vcpus()
                   kvm_arch_vcpu_free()

Neither of the paths handles VCPU free. We need to do it in
kvm_arch_vcpu_free() corresponding to the memory allocation in
kvm_arch_vcpu_create().

Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-06 18:57:29 -07:00
..
00README.txt
Kconfig MIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION 2013-07-19 12:45:57 +02:00
Makefile
kvm_cb.c
kvm_locore.S mips/kvm: Make kvm_locore.S 64-bit buildable/safe. 2013-08-26 12:30:49 +03:00
kvm_mips.c MIPS: KVM: Fix memory leak on VCPU 2014-07-06 18:57:29 -07:00
kvm_mips_comm.h
kvm_mips_commpage.c
kvm_mips_dyntrans.c
kvm_mips_emul.c MIPS: KVM: Pass reserved instruction exceptions to guest 2014-05-13 13:32:48 +02:00
kvm_mips_int.c
kvm_mips_int.h
kvm_mips_opcode.h
kvm_mips_stats.c
kvm_tlb.c mips: delete non-required instances of include <linux/init.h> 2014-01-24 22:39:56 +01:00
kvm_trap_emul.c mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG 2013-06-03 10:58:54 +03:00
trace.h