diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 9e53673e5542..469d9000b51e 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -318,13 +318,18 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) 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);