Commit 0fd186c0 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] symlink: fix missing 'depth' initialization

Now we always care about one part of nameidata --- ->depth.  And we need
to make sure it's always initialized.

generic_readlink() was missing that part.
parent a7993279
......@@ -2197,7 +2197,9 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c
int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen)
{
struct nameidata nd;
int res = dentry->d_inode->i_op->follow_link(dentry, &nd);
int res;
nd.depth = 0;
res = dentry->d_inode->i_op->follow_link(dentry, &nd);
if (!res) {
res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd));
if (dentry->d_inode->i_op->put_link)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment