From 9a6f486e56f927eeb8dc7e4e0d84f6bb95eeaa0f Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Thu, 25 Jun 2020 16:01:27 +1200 Subject: [PATCH] yaffs-vfs-multi.c: Handle search context properly to prevent leaking Fix potential memory leak due to search context not being closed properly. Thank you to George Pee for reporting this issue. Signed-off-by: Charles Manning --- yaffs_vfs_multi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index 3044db7..19c8919 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -1832,10 +1832,8 @@ static int yaffs_iterate(struct file *f, struct dir_context *dc) goto out; } - if (!dir_emit_dots(f, dc)) { - yaffs_gross_unlock(dev); - return 0; - } + if (!dir_emit_dots(f, dc)) + goto out; curoffs = 1; -- 2.30.2