From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] kvm: irqchip: fix memory leak Date: Wed, 4 Nov 2015 13:48:15 +0100 Message-ID: <5639FE8F.7010907@redhat.com> References: <1441177433-20225-1-git-send-email-sudipm.mukherjee@gmail.com> <20151103211749.GH7714@gandi.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm@vger.kernel.org, Sudip Mukherjee To: William Dauchy Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48499 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbbKDMsV (ORCPT ); Wed, 4 Nov 2015 07:48:21 -0500 In-Reply-To: <20151103211749.GH7714@gandi.net> Sender: kvm-owner@vger.kernel.org List-ID: On 03/11/2015 22:17, William Dauchy wrote: > Hi Paolo, > > I was wondering it this could be a valid candidate for -stable, don't you think? > (commit ba60c41) Indeed, feel free to propose it! Paolo > Best regards, > > On Sep02 12:33, Sudip Mukherjee wrote: >> We were taking the exit path after checking ue->flags and return value >> of setup_routing_entry(), but 'e' was not freed incase of a failure. >> >> Signed-off-by: Sudip Mukherjee >> --- >> virt/kvm/irqchip.c | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c >> index 21c1424..c63e54f 100644 >> --- a/virt/kvm/irqchip.c >> +++ b/virt/kvm/irqchip.c >> @@ -213,11 +213,15 @@ int kvm_set_irq_routing(struct kvm *kvm, >> goto out; >> >> r = -EINVAL; >> - if (ue->flags) >> + if (ue->flags) { >> + kfree(e); >> goto out; >> + } >> r = setup_routing_entry(new, e, ue); >> - if (r) >> + if (r) { >> + kfree(e); >> goto out; >> + } >> ++ue; >> } >> >> -- >> 1.9.1 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe kvm" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >