[3.8.y.z extended stable] Patch "KVM: s390: kvm/sigp.c: fix memory leakage" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Fri Feb 7 21:36:35 UTC 2014


This is a note to let you know that I have just added a patch titled

    KVM: s390: kvm/sigp.c: fix memory leakage

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

This patch is scheduled to be released in version 3.8.13.18.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 2a850f85c8474b5cf63e46bbd1a07d18a4565892 Mon Sep 17 00:00:00 2001
From: Cong Ding <dinggnu at gmail.com>
Date: Tue, 15 Jan 2013 11:17:29 +0100
Subject: KVM: s390: kvm/sigp.c: fix memory leakage

commit a046b816a4587c7898772af7cc7e6798cc8b56dd upstream.

the variable inti should be freed in the branch CPUSTAT_STOPPED.

Signed-off-by: Cong Ding <dinggnu at gmail.com>
Signed-off-by: Cornelia Huck <cornelia.huck at de.ibm.com>
Signed-off-by: Gleb Natapov <gleb at redhat.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 arch/s390/kvm/sigp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 566ddf6..1278873 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -137,8 +137,10 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action)
 	inti->type = KVM_S390_SIGP_STOP;

 	spin_lock_bh(&li->lock);
-	if ((atomic_read(li->cpuflags) & CPUSTAT_STOPPED))
+	if ((atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) {
+		kfree(inti);
 		goto out;
+	}
 	list_add_tail(&inti->list, &li->list);
 	atomic_set(&li->active, 1);
 	atomic_set_mask(CPUSTAT_STOP_INT, li->cpuflags);
--
1.8.3.2





More information about the kernel-team mailing list