[ 3.5.y.z extended stable ] Patch "fs/fscache/stats.c: fix memory leak" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Tue May 7 10:33:47 UTC 2013


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

    fs/fscache/stats.c: fix memory leak

to the linux-3.5.y-queue branch of the 3.5.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.5.y-queue

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.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From fa1f258becaad90a65d4a888f22b9e51fa634032 Mon Sep 17 00:00:00 2001
From: Anurup m <anurup.m at huawei.com>
Date: Mon, 29 Apr 2013 15:05:52 -0700
Subject: [PATCH] fs/fscache/stats.c: fix memory leak

commit ec686c9239b4d472052a271c505d04dae84214cc upstream.

There is a kernel memory leak observed when the proc file
/proc/fs/fscache/stats is read.

The reason is that in fscache_stats_open, single_open is called and the
respective release function is not called during release.  Hence fix
with correct release function - single_release().

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=57101

Signed-off-by: Anurup m <anurup.m at huawei.com>
Cc: shyju pv <shyju.pv at huawei.com>
Cc: Sanil kumar <sanil.kumar at huawei.com>
Cc: Nataraj m <nataraj.m at huawei.com>
Cc: Li Zefan <lizefan at huawei.com>
Cc: David Howells <dhowells at redhat.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 fs/fscache/stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c
index 4765190..73c0bd7 100644
--- a/fs/fscache/stats.c
+++ b/fs/fscache/stats.c
@@ -276,5 +276,5 @@ const struct file_operations fscache_stats_fops = {
 	.open		= fscache_stats_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= seq_release,
+	.release        = single_release,
 };
--
1.8.1.2





More information about the kernel-team mailing list