they are always called next to each other; moreover,
terminate_walk() is more symmetrical that way.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
path_put(&nd->path);
for (i = 0; i < nd->depth; i++)
path_put(&nd->stack[i].link);
+ if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) {
+ path_put(&nd->root);
+ nd->root.mnt = NULL;
+ }
} else {
nd->flags &= ~LOOKUP_RCU;
if (!(nd->flags & LOOKUP_ROOT))
return ERR_PTR(-ECHILD);
}
-static void path_cleanup(struct nameidata *nd)
-{
- if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) {
- path_put(&nd->root);
- nd->root.mnt = NULL;
- }
-}
-
static const char *trailing_symlink(struct nameidata *nd)
{
const char *s;
nd->path.dentry = NULL;
}
terminate_walk(nd);
- path_cleanup(nd);
return err;
}
nd->path.dentry = NULL;
}
terminate_walk(nd);
- path_cleanup(nd);
return err;
}
}
}
terminate_walk(nd);
- path_cleanup(nd);
return err;
}
}
}
terminate_walk(nd);
- path_cleanup(nd);
out2:
if (!(opened & FILE_OPENED)) {
BUG_ON(!error);