linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh: fix seq_file memory leak
@ 2008-06-24  5:30 Li Zefan
  2008-06-24  5:50 ` Paul Mundt
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2008-06-24  5:30 UTC (permalink / raw)
  To: Paul Mundt; +Cc: linux-sh, LKML

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>
---
 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 0b0ec6e..95653e2 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)
-- 
1.5.4.rc3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sh: fix seq_file memory leak
  2008-06-24  5:30 [PATCH] sh: fix seq_file memory leak Li Zefan
@ 2008-06-24  5:50 ` Paul Mundt
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2008-06-24  5:50 UTC (permalink / raw)
  To: Li Zefan; +Cc: linux-sh, LKML

On Tue, Jun 24, 2008 at 01:30:23PM +0800, Li Zefan wrote:
> 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>

Good catch. Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-24  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24  5:30 [PATCH] sh: fix seq_file memory leak Li Zefan
2008-06-24  5:50 ` Paul Mundt

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