sh: fix seq_file memory leak
PATCH 1/1 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 <[email protected]>
--- arch/sh/mm/cache-debugfs.c | 2 +- arch/sh/mm/pmb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/sh/mm/cache-debugfs.c +1 -1
@@ -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 )
arch/sh/mm/pmb.c +1 -1
@@ -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 )
Signature · 1 line
1.5.4.rc3
Quoted 4 lines · Li Zefan
When using
single_open(),single_release()should be used instead ofseq_release(), otherwise there is a memory leak.Signed-off-by Li Zefan <[email protected]>
Good catch. Applied, thanks.