From: Charles Manning <[email protected]>

commit  27f18203551940abf35826a66978daf1b8124c6b from
git://www.aleph1.co.uk/yaffs2

Thanks to Jisheng Zhang <[email protected]> for supplying this patch

There is a kernel memory leak observed when the proc file /proc/yaffs
is read. This reason is that in yaffs_proc_open, single_open is called
and the respective release function is not called during release.

Fix with correct release function - single_release().

Signed-off-by: Jisheng Zhang <[email protected]>
Signed-off-by: Quanyang Wang <[email protected]>
---
 fs/yaffs2/yaffs_vfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c
index d3f89e07401b..4fbd0a42ff3d 100644
--- a/fs/yaffs2/yaffs_vfs.c
+++ b/fs/yaffs2/yaffs_vfs.c
@@ -3697,6 +3697,7 @@ static struct file_operations procfs_ops = {
        .open  = yaffs_proc_open,
        .read  = seq_read,
        .write = yaffs_proc_write,
+       .release = single_release,
 };
 
 static int yaffs_procfs_init(void)
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8490): 
https://lists.yoctoproject.org/g/linux-yocto/message/8490
Mute This Topic: https://lists.yoctoproject.org/mt/71993458/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to