Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179404
b: refs/heads/master
c: 806892e
h: refs/heads/master
v: v3
  • Loading branch information
OGAWA Hirofumi authored and Al Viro committed Jan 14, 2010
1 parent d64970c commit cddb153
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d125529c6cbfe570ce3bf9a0728548f087499da
refs/heads/master: 806892e9e12e731a0ca76c8f62ad95cf8eea9614
24 changes: 12 additions & 12 deletions trunk/fs/ecryptfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,31 +715,31 @@ static void *ecryptfs_follow_link(struct dentry *dentry, struct nameidata *nd)
/* Released in ecryptfs_put_link(); only release here on error */
buf = kmalloc(len, GFP_KERNEL);
if (!buf) {
rc = -ENOMEM;
buf = ERR_PTR(-ENOMEM);
goto out;
}
old_fs = get_fs();
set_fs(get_ds());
rc = dentry->d_inode->i_op->readlink(dentry, (char __user *)buf, len);
set_fs(old_fs);
if (rc < 0)
goto out_free;
else
if (rc < 0) {
kfree(buf);
buf = ERR_PTR(rc);
} else
buf[rc] = '\0';
rc = 0;
nd_set_link(nd, buf);
goto out;
out_free:
kfree(buf);
out:
return ERR_PTR(rc);
nd_set_link(nd, buf);
return NULL;
}

static void
ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr)
{
/* Free the char* */
kfree(nd_get_link(nd));
char *buf = nd_get_link(nd);
if (!IS_ERR(buf)) {
/* Free the char* */
kfree(buf);
}
}

/**
Expand Down

0 comments on commit cddb153

Please sign in to comment.