Re: [PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread nick
On 2015-08-07 09:59 AM, Paolo Bonzini wrote: > > > On 07/08/2015 15:47, Nicholas Krause wrote: >> -kvm_set_irq_routing(opp->kvm, routing, 0, 0); >> +ret = kvm_set_irq_routing(opp->kvm, routing, 0, 0); >> +if (ret) { >> +kfree(routing); >> +return ret; >> +

Re: [PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread Paolo Bonzini
On 07/08/2015 15:47, Nicholas Krause wrote: > - kvm_set_irq_routing(opp->kvm, routing, 0, 0); > + ret = kvm_set_irq_routing(opp->kvm, routing, 0, 0); > + if (ret) { > + kfree(routing); > + return ret; > + } > > kfree(routing); > return 0; You

[PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread Nicholas Krause
This fixes error handling in the function mpic_set_default_irq_routing by checking if the call to the function kvm_set_irq_routing has failed and if so exit immediately to the caller by first freeing the structure pointer routing in order to avoid a memory leak before returning the error code retur

Re: [PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread Paolo Bonzini
On 06/08/2015 19:13, Nicholas Krause wrote: > diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c > index 6249cdc..5a18859 100644 > --- a/arch/powerpc/kvm/mpic.c > +++ b/arch/powerpc/kvm/mpic.c > @@ -1641,13 +1641,16 @@ static void mpic_destroy(struct kvm_device *dev) > static int mpi

[PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-06 Thread Nicholas Krause
This fixes error handling in the function mpic_set_default_irq_routing by checking if the call to the function kvm_set_irq_routing has failed and if so exit immediately to the caller by returning the error code returned by the call to mpic_set_default_irq_routing. Signed-off-by: Nicholas Krause -