• Alexey Dobriyan's avatar
    "[PATCH] Fix leaks on /proc/{*/sched,sched_debug,timer_list,timer_stats}" and · b8a12a62
    Alexey Dobriyan authored
    "[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: default avatarAlexey Dobriyan <adobriyan@sw.ru>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    b8a12a62
seq_file.c 15.9 KB