summaryrefslogtreecommitdiffstats
path: root/fs/ext4/symlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/symlink.c')
-rw-r--r--fs/ext4/symlink.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
index 04a7850a0d45..0a26cbd529c8 100644
--- a/fs/ext4/symlink.c
+++ b/fs/ext4/symlink.c
@@ -68,12 +68,11 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,
paddr = pstr.name;
res = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr);
- if (res < 0)
+ if (res)
goto errout;
/* Null-terminate the name */
- if (res <= pstr.len)
- paddr[res] = '\0';
+ paddr[pstr.len] = '\0';
if (cpage)
put_page(cpage);
set_delayed_call(done, kfree_link, paddr);