Fix leaks on /proc/{*/sched,sched_debug,timer_list,timer_stats}
authorAlexey Dobriyan <adobriyan@sw.ru>
Tue, 31 Jul 2007 07:38:50 +0000 (00:38 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 31 Jul 2007 22:39:40 +0000 (15:39 -0700)
On every open/close one struct seq_operations leaks.
Kudos to /proc/slab_allocators.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c
kernel/sched_debug.c
kernel/time/timer_list.c
kernel/time/timer_stats.c

index 3c77d5a64e7ce6512e896d768d8bb74501372a89..19489b0d5554860e28a1b7e6aeefc5d23fa0d992 100644 (file)
@@ -927,7 +927,7 @@ static const struct file_operations proc_pid_sched_operations = {
        .read           = seq_read,
        .write          = sched_write,
        .llseek         = seq_lseek,
-       .release        = seq_release,
+       .release        = single_release,
 };
 
 #endif
index 42970f723a97153efd384d61b6512677c5cf2a56..0eca442b77922b8702ef0167f8e4361d0fd5ffe1 100644 (file)
@@ -200,7 +200,7 @@ static struct file_operations sched_debug_fops = {
        .open           = sched_debug_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
-       .release        = seq_release,
+       .release        = single_release,
 };
 
 static int __init init_sched_debug_procfs(void)
index e5edc3a22a08d4100d57c6ca30a160b4f50c9c45..fdb2e03d4fe0d40943b72a11050fafefefbf81d9 100644 (file)
@@ -267,7 +267,7 @@ static struct file_operations timer_list_fops = {
        .open           = timer_list_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
-       .release        = seq_release,
+       .release        = single_release,
 };
 
 static int __init init_timer_list_procfs(void)
index 8ed62fda16c6c1a4b9a43f70f7bfa40da76c6157..3c38fb5eae1b4a6d5ccaab8b8b079b130af675fe 100644 (file)
@@ -399,7 +399,7 @@ static struct file_operations tstats_fops = {
        .read           = seq_read,
        .write          = tstats_write,
        .llseek         = seq_lseek,
-       .release        = seq_release,
+       .release        = single_release,
 };
 
 void __init init_timer_stats(void)