diff options
-rw-r--r-- | fs/ecryptfs/inode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 89209f00f9c7..5e78fc179886 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -673,10 +673,11 @@ static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
673 | ecryptfs_printk(KERN_DEBUG, "Calling readlink w/ " | 673 | ecryptfs_printk(KERN_DEBUG, "Calling readlink w/ " |
674 | "dentry->d_name.name = [%s]\n", dentry->d_name.name); | 674 | "dentry->d_name.name = [%s]\n", dentry->d_name.name); |
675 | rc = dentry->d_inode->i_op->readlink(dentry, (char __user *)buf, len); | 675 | rc = dentry->d_inode->i_op->readlink(dentry, (char __user *)buf, len); |
676 | buf[rc] = '\0'; | ||
677 | set_fs(old_fs); | 676 | set_fs(old_fs); |
678 | if (rc < 0) | 677 | if (rc < 0) |
679 | goto out_free; | 678 | goto out_free; |
679 | else | ||
680 | buf[rc] = '\0'; | ||
680 | rc = 0; | 681 | rc = 0; |
681 | nd_set_link(nd, buf); | 682 | nd_set_link(nd, buf); |
682 | goto out; | 683 | goto out; |