fix memory leak when /proc/yaffs is read master
authorCharles Manning <cdhmanning@gmail.com>
Mon, 21 Oct 2019 19:46:14 +0000 (08:46 +1300)
committerCharles Manning <cdhmanning@gmail.com>
Mon, 21 Oct 2019 19:48:12 +0000 (08:48 +1300)
Thanks to Jisheng Zhang <Jisheng.Zhang@synaptics.com> 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 <Jisheng.Zhang@synaptics.com>
yaffs_vfs_multi.c

index a36d9bf..e4edb2c 100644 (file)
@@ -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)