From: Paolo Bonzini <pbonzini@redhat.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Gleb Natapov <gleb@kernel.org>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: irqchip: fix memory leak
Date: Mon, 7 Sep 2015 22:06:18 +0200 [thread overview]
Message-ID: <55EDEE3A.1030700@redhat.com> (raw)
In-Reply-To: <1441177433-20225-1-git-send-email-sudipm.mukherjee@gmail.com>
On 02/09/2015 09:03, 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;
> }
>
>
Queued, thanks.
Paolo
next prev parent reply other threads:[~2015-09-07 20:06 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 [this message]
2015-11-03 21:17 ` William Dauchy
2015-11-04 12:48 ` Paolo Bonzini
2015-11-04 12:57 ` Paolo Bonzini
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=55EDEE3A.1030700@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.