linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virt: kvm: arm: vgic: Process the failure case when kvm_register_device_ops() fails
@ 2014-11-13 15:04 Chen Gang
  2014-11-13 15:30 ` Marc Zyngier
  0 siblings, 1 reply; 8+ messages in thread
From: Chen Gang @ 2014-11-13 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

When kvm_register_device_ops() fails, also need call free_percpu_irq()
just like others have down within kvm_vgic_hyp_init().

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 virt/kvm/arm/vgic.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 3aaca49..b799f17 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -2470,8 +2470,14 @@ int kvm_vgic_hyp_init(void)
 
 	on_each_cpu(vgic_init_maintenance_interrupt, NULL, 1);
 
-	return kvm_register_device_ops(&kvm_arm_vgic_v2_ops,
-				       KVM_DEV_TYPE_ARM_VGIC_V2);
+	ret = kvm_register_device_ops(&kvm_arm_vgic_v2_ops,
+				      KVM_DEV_TYPE_ARM_VGIC_V2);
+	if (ret) {
+		kvm_err("Cannot register device ops\n");
+		goto out_free_irq;
+	}
+
+	return 0;
 
 out_free_irq:
 	free_percpu_irq(vgic->maint_irq, kvm_get_running_vcpus());
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-11-14 15:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-13 15:04 [PATCH] virt: kvm: arm: vgic: Process the failure case when kvm_register_device_ops() fails Chen Gang
2014-11-13 15:30 ` Marc Zyngier
2014-11-14 14:05   ` Chen Gang
2014-11-14 14:05   ` Chen Gang
2014-11-14 14:09     ` Marc Zyngier
2014-11-14 14:27       ` Chen Gang
2014-11-14 14:53         ` Marc Zyngier
2014-11-14 15:18           ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).