"[PATCH] Fix leaks on /proc/{*/sched,sched_debug,timer_list,timer_stats}" and
commit5c8ad1b3e164ce59cee7611744c8c92baf783d29
authorAlexey Dobriyan <adobriyan@sw.ru>
Fri, 25 Sep 2009 20:12:47 +0000 (25 22:12 +0200)
committerjames toy <toyj@union.edu>
Fri, 25 Sep 2009 20:12:47 +0000 (25 22:12 +0200)
tree6c4473b8b865699dde638d95007f781ee1f9b125
parent7f31259e23a4eb1b95c2f13e816c286a832264dc
"[PATCH] Fix leaks on /proc/{*/sched,sched_debug,timer_list,timer_stats}" and
"[PATCH] Fix leak on /proc/lockdep_stats" fixed 5 leaks which happen if one
uses single_open() as .open function and seq_release() as .release function.

Let's add small amount of runtime checking.

Sample output is:

memory leak: 'timer_list'
WARNING: at fs/seq_file.c:289 seq_release()
 [<c015e311>] seq_release+0x53/0x68
 [<c0171bd8>] proc_reg_release+0x63/0x74
 [<c0149877>] __fput+0x28/0xd3
 [<c0147681>] filp_close+0x48/0x4f
 [<c014876a>] sys_close+0x74/0xbe
 [<c010248e>] sysenter_past_esp+0x5f/0x85
 =======================

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/seq_file.c
include/linux/seq_file.h