Fix hang caused by returning with lock held
[yaffs2.git] / yaffs_vfs_multi.c
index 707fcb39911417b3fe3d67301110a647135e7c59..de3dd75988ef7de715fd80ec28ff6b96e501a903 100644 (file)
@@ -1816,8 +1816,10 @@ static int yaffs_iterate(struct file *f, struct dir_context *dc)
                goto out;
        }
 
-       if (!dir_emit_dots(f, dc))
+       if (!dir_emit_dots(f, dc)) {
+               yaffs_gross_unlock(dev);
                return 0;
+       }
 
        curoffs = 1;