Merge getxattr prototype change into work.lookups
[linux-2.6-block.git] / fs / f2fs / namei.c
index db874ad3514a7a8bde574203315c2b48672ba122..324ed3812f30e906cdb5d9c2a6135135b5035dc4 100644 (file)
@@ -1027,12 +1027,6 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
                goto errout;
        }
 
-       /* this is broken symlink case */
-       if (unlikely(cstr.name[0] == 0)) {
-               res = -ENOENT;
-               goto errout;
-       }
-
        if ((cstr.len + sizeof(struct fscrypt_symlink_data) - 1) > max_size) {
                /* Symlink data on the disk is corrupted */
                res = -EIO;
@@ -1046,17 +1040,23 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
        if (res < 0)
                goto errout;
 
+       /* this is broken symlink case */
+       if (unlikely(pstr.name[0] == 0)) {
+               res = -ENOENT;
+               goto errout;
+       }
+
        paddr = pstr.name;
 
        /* Null-terminate the name */
        paddr[res] = '\0';
 
-       page_cache_release(cpage);
+       put_page(cpage);
        set_delayed_call(done, kfree_link, paddr);
        return paddr;
 errout:
        fscrypt_fname_free_buffer(&pstr);
-       page_cache_release(cpage);
+       put_page(cpage);
        return ERR_PTR(res);
 }