aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-04-22 14:03:48 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2015-05-04 17:15:16 -0400
commit7263b1bd0490fca68ee7eedb0b6973cb86d4701c (patch)
tree176d95bda119fcee53260373869153c800dde8ef /fs
parent5463e7c18e51152104aba9614e6abfc039a8b710 (diff)
f2fs: fix wrong error hanlder in f2fs_follow_link
The page_follow_link_light returns NULL and its error pointer was remained in nd->path. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/namei.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 7e3794edae42..658e8079aaf9 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -298,16 +298,14 @@ fail:
298 298
299static void *f2fs_follow_link(struct dentry *dentry, struct nameidata *nd) 299static void *f2fs_follow_link(struct dentry *dentry, struct nameidata *nd)
300{ 300{
301 struct page *page; 301 struct page *page = page_follow_link_light(dentry, nd);
302 302
303 page = page_follow_link_light(dentry, nd); 303 if (IS_ERR_OR_NULL(page))
304 if (IS_ERR(page))
305 return page; 304 return page;
306 305
307 /* this is broken symlink case */ 306 /* this is broken symlink case */
308 if (*nd_get_link(nd) == 0) { 307 if (*nd_get_link(nd) == 0) {
309 kunmap(page); 308 page_put_link(dentry, nd, page);
310 page_cache_release(page);
311 return ERR_PTR(-ENOENT); 309 return ERR_PTR(-ENOENT);
312 } 310 }
313 return page; 311 return page;