Skip to contentSkip to conversation

kvm:powerpc:Fix incorrect return statement in the function mpic_set_default_irq_routing

PATCH RESEND Superseded Nicholas Krause 1 participant 1 message Jan 11, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 kvm:powerpc:Fix incorrect return statement in the function mpic_set_default_irq_routing

This fixes the incorrect return statement in the function mpic_set_default_irq_routing from always returning zero to signal success to this function's caller to instead return the return value of kvm_set_irq_routing as this function can fail and we need to correctly signal the caller of mpic_set_default_irq_routing when the call to this particular function has failed.

---
 arch/powerpc/kvm/mpic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/kvm/mpic.c +3 -2
index 6249cdc..b14b85a 100644
@@ -1641,16 +1641,17 @@ static void mpic_destroy(struct kvm_device *dev)
 static int mpic_set_default_irq_routing(struct openpic *opp)
 {
 	struct kvm_irq_routing_entry *routing;
+	int ret;
 
 	/* Create a nop default map, so that dereferencing it still works */
 	routing = kzalloc((sizeof(*routing)), GFP_KERNEL);
 	if (!routing)
 		return -ENOMEM;
 
-	kvm_set_irq_routing(opp->kvm, routing, 0, 0);
+	ret = kvm_set_irq_routing(opp->kvm, routing, 0, 0);
 
 	kfree(routing);
-	return 0;
+	return ret;
 }
 
 static int mpic_create(struct kvm_device *dev, u32 type)
Signature · 6 lines
2.1.4

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev