From 27f18203551940abf35826a66978daf1b8124c6b Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Tue, 22 Oct 2019 08:46:14 +1300 Subject: [PATCH] fix memory leak when /proc/yaffs is read Thanks to Jisheng Zhang 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 --- yaffs_vfs_multi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index a36d9bf..e4edb2c 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -3687,6 +3687,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.30.2