From: Paolo Bonzini <pbonzini@redhat.com>
To: William Dauchy <william@gandi.net>
Cc: Gleb Natapov <gleb@kernel.org>,
kvm@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: Re: [PATCH] kvm: irqchip: fix memory leak
Date: Wed, 4 Nov 2015 13:57:15 +0100 [thread overview]
Message-ID: <563A00AB.4010505@redhat.com> (raw)
In-Reply-To: <20151103211749.GH7714@gandi.net>
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)
Certainly, feel free to propose it to stable@vger.kernel.org!
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 <sudip@vectorindia.org>
>> ---
>> 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
>
prev parent reply other threads:[~2015-11-04 12:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 7:03 [PATCH] kvm: irqchip: fix memory leak Sudip Mukherjee
2015-09-07 20:06 ` Paolo Bonzini
2015-11-03 21:17 ` William Dauchy
2015-11-04 12:48 ` Paolo Bonzini
2015-11-04 12:57 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563A00AB.4010505@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
--cc=william@gandi.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).