diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-12-01 11:41:50 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-12-04 12:07:55 -0800 |
commit | e9837bc2a4a407ee366143cf721ee77154ac051e (patch) | |
tree | 442b76bf82d1cc30d57be11866eb2f0d9439a499 /fs/f2fs/dir.c | |
parent | 807b1e1c8e08452948495b1a9985ab46d329e5c2 (diff) |
f2fs: clean up error path in f2fs_readdir
No logic changes, just clean up the error path.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r-- | fs/f2fs/dir.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 9de898d2ddff..6554fd5fce88 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -867,18 +867,15 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx) make_dentry_ptr(inode, &d, (void *)dentry_blk, 1); - if (f2fs_fill_dentries(ctx, &d, n * NR_DENTRY_IN_BLOCK, &fstr)) - goto stop; + if (f2fs_fill_dentries(ctx, &d, n * NR_DENTRY_IN_BLOCK, &fstr)) { + kunmap(dentry_page); + f2fs_put_page(dentry_page, 1); + break; + } ctx->pos = (n + 1) * NR_DENTRY_IN_BLOCK; kunmap(dentry_page); f2fs_put_page(dentry_page, 1); - dentry_page = NULL; - } -stop: - if (dentry_page && !IS_ERR(dentry_page)) { - kunmap(dentry_page); - f2fs_put_page(dentry_page, 1); } out: f2fs_fname_crypto_free_buffer(&fstr); |