hostfs ->follow_link() braino
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 18 Aug 2010 10:21:10 +0000 (06:21 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 18 Aug 2010 10:21:10 +0000 (06:21 -0400)
we want the assignment to err done inside the if () to be
visible after it, so (re)declaring err inside if () body
is wrong.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/hostfs/hostfs_kern.c

index 77c4f6e..f7dc9b5 100644 (file)
@@ -876,7 +876,7 @@ static void *hostfs_follow_link(struct dentry *dentry, struct nameidata *nd)
                char *path = dentry_name(dentry);
                int err = -ENOMEM;
                if (path) {
-                       int err = hostfs_do_readlink(path, link, PATH_MAX);
+                       err = hostfs_do_readlink(path, link, PATH_MAX);
                        if (err == PATH_MAX)
                                err = -E2BIG;
                        __putname(path);