aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/namei.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 336d43d9c..bfaec10af 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -319,13 +319,18 @@ fail:
static void *f2fs_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct page *page;
+ char *link;
page = page_follow_link_light(dentry, nd);
if (IS_ERR(page))
return page;
+ link = nd_get_link(nd);
+ if (IS_ERR(link))
+ return link;
+
/* this is broken symlink case */
- if (*nd_get_link(nd) == 0) {
+ if (*link == 0) {
kunmap(page);
page_cache_release(page);
return ERR_PTR(-ENOENT);