sh: fix seq_file memory leak

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 10:05 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=45dabf...
Commit:     45dabf1427a0a876f733b07239ade1bdb0e06010
Parent:     c9272c4f9fbe2087beb3392f526dc5b19efaa56b
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Tue Jun 24 13:30:23 2008 +0800
Committer:  Paul Mundt <lethal@linux-sh.org>
CommitDate: Mon Jul 28 18:10:27 2008 +0900

    sh: fix seq_file memory leak
    
    When using single_open(), single_release() should be used instead
    of seq_release(), otherwise there is a memory leak.
    
    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Signed-off-by: Paul Mundt <lethal@linux-sh.org>
---
 arch/sh/mm/cache-debugfs.c |    2 +-
 arch/sh/mm/pmb.c           |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c
index c5b56d5..0e189cc 100644
--- a/arch/sh/mm/cache-debugfs.c
+++ b/arch/sh/mm/cache-debugfs.c
@@ -120,7 +120,7 @@ static const struct file_operations cache_debugfs_fops = {
 	.open		= cache_debugfs_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= seq_release,
+	.release	= single_release,
 };
 
 static int __init cache_debugfs_init(void)
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 46911bc..cef7276 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -385,7 +385,7 @@ static const struct file_operations pmb_debugfs_fops = {
 	.open		= pmb_debugfs_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= seq_release,
+	.release	= single_release,
 };
 
 static int __init pmb_debugfs_init(void)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
sh: fix seq_file memory leak, Linux Kernel Mailing ..., (Mon Jul 28, 10:05 am)