Re: [PATCH] KVM: Fix memory leak on VCPU creation error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/13/2011 02:32 AM, Jan Kiszka wrote:
From: Jan Kiszka<jan.kiszka@xxxxxxxxxxx>

If kvm_arch_vcpu_setup failed, we leaked the allocated VCPU structure so
far.

@@ -1609,18 +1609,18 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)

  	r = kvm_arch_vcpu_setup(vcpu);
  	if (r)
-		return r;
+		goto vcpu_destroy;


kvm_arch_vcpu_setup() (at least x86's) does a vcpu->free() on failure. I think the current code is correct (if confusing).

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux