aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fs/kernfs/dir.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 1e98efc2bf6d..a387534c9577 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -1684,14 +1684,11 @@ static int kernfs_fop_readdir(struct file *file, struct dir_context *ctx)
kernfs_get(pos);
mutex_unlock(&kernfs_mutex);
- if (unlikely(!dir_emit(ctx, name, len, ino, type))) {
- kernfs_put(pos);
- goto out;
- }
+ if (!dir_emit(ctx, name, len, ino, type))
+ return 0;
mutex_lock(&kernfs_mutex);
}
mutex_unlock(&kernfs_mutex);
-out:
file->private_data = NULL;
ctx->pos = INT_MAX;
return 0;