From: Charles Manning Date: Mon, 21 Oct 2019 19:46:14 +0000 (+1300) Subject: fix memory leak when /proc/yaffs is read X-Git-Url: https://yaffs.net/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=27f18203551940abf35826a66978daf1b8124c6b 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 --- 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)