From: Charles Manning Date: Thu, 25 Jun 2020 04:01:27 +0000 (+1200) Subject: yaffs-vfs-multi.c: Handle search context properly to prevent leaking X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=9a6f486e56f927eeb8dc7e4e0d84f6bb95eeaa0f;hp=0ca67da389c41a10ba51b85905a2437669c0471d 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 --- 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;