stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "kvm: irqchip: fix memory leak" has been added to the 4.2-stable tree
@ 2015-11-06  6:58 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-11-06  6:58 UTC (permalink / raw)
  To: sudipm.mukherjee, gregkh, pbonzini, sudip, william; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    kvm: irqchip: fix memory leak

to the 4.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-irqchip-fix-memory-leak.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From ba60c41ae392b473a1897faa0b8739fcb8759d69 Mon Sep 17 00:00:00 2001
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: Wed, 2 Sep 2015 12:33:53 +0530
Subject: kvm: irqchip: fix memory leak

From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

commit ba60c41ae392b473a1897faa0b8739fcb8759d69 upstream.

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>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: William Dauchy <william@gandi.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 virt/kvm/irqchip.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- 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;
 	}
 


Patches currently in stable-queue which might be from sudipm.mukherjee@gmail.com are

queue-4.2/kvm-irqchip-fix-memory-leak.patch
queue-4.2/thermal-exynos-fix-register-read-in-tmu.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-06  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-06  6:58 Patch "kvm: irqchip: fix memory leak" has been added to the 4.2-stable tree gregkh

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).