... instead of just failing with -EINVAL
Acked-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
full_path = cifs_build_path_to_root(vol, cifs_sb,
cifs_sb_master_tcon(cifs_sb));
if (full_path == NULL)
full_path = cifs_build_path_to_root(vol, cifs_sb,
cifs_sb_master_tcon(cifs_sb));
if (full_path == NULL)
+ return ERR_PTR(-ENOMEM);
cFYI(1, "Get root dentry for %s", full_path);
cFYI(1, "Get root dentry for %s", full_path);
dchild = d_alloc(dparent, &name);
if (dchild == NULL) {
dput(dparent);
dchild = d_alloc(dparent, &name);
if (dchild == NULL) {
dput(dparent);
+ dparent = ERR_PTR(-ENOMEM);
if (rc) {
dput(dchild);
dput(dparent);
if (rc) {
dput(dchild);
dput(dparent);
goto out;
}
alias = d_materialise_unique(dchild, inode);
goto out;
}
alias = d_materialise_unique(dchild, inode);
dput(dchild);
if (IS_ERR(alias)) {
dput(dparent);
dput(dchild);
if (IS_ERR(alias)) {
dput(dparent);
+ dparent = ERR_PTR(-EINVAL); /* XXX */
goto out;
}
dchild = alias;
goto out;
}
dchild = alias;
}
root = cifs_get_root(volume_info, sb);
}
root = cifs_get_root(volume_info, sb);
- if (root == NULL) {
- root = ERR_PTR(-EINVAL); /* XXX */
cFYI(1, "dentry root is: %p", root);
goto out;
cFYI(1, "dentry root is: %p", root);
goto out;