yaffs-vfs-multi.c: Handle search context properly to prevent leaking
authorCharles Manning <cdhmanning@gmail.com>
Thu, 25 Jun 2020 04:01:27 +0000 (16:01 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Thu, 25 Jun 2020 04:01:27 +0000 (16:01 +1200)
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 <cdhmanning@gmail.com>
yaffs_vfs_multi.c

index 3044db72998fa052a08b99be8eb2509c37610ba2..19c891907e14fd521de7a974950a2d4023e3004d 100644 (file)
@@ -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;