[PATCH 02/10] KVM: ARM: VGIC: Fix the logic bug when the vgic_vcpu maps alloc failed.

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

 



When the vgic_vcpu maps alloc failed, it will be better goto out branch and destroy
the vGIC, than just break the loop.

Signed-off-by: wanghaibin <wanghaibin.wang@xxxxxxxxxx>
---
 virt/kvm/arm/vgic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 57e45ff..d411551 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -1863,7 +1863,7 @@ static int vgic_init_maps(struct kvm *kvm)
 		ret = vgic_vcpu_init_maps(vcpu, nr_irqs);
 		if (ret) {
 			kvm_err("VGIC: Failed to allocate vcpu memory\n");
-			break;
+			goto out;
 		}
 	}
 
-- 
1.7.1


_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm




[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux