move decrement of nd->depth on successful returns into the callers.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
s = get_link(nd);
if (unlikely(IS_ERR(s)))
return PTR_ERR(s);
- if (unlikely(!s)) {
- nd->depth--;
+ if (unlikely(!s))
return 0;
- }
if (*s == '/') {
if (!nd->root.mnt)
set_root(nd);
put_link(nd);
return error;
}
- nd->depth--;
return 0;
}
if (err)
break;
err = lookup_last(nd);
+ nd->depth--;
put_link(nd);
}
}
if (err)
break;
err = mountpoint_last(nd, path);
+ nd->depth--;
put_link(nd);
}
out:
if (unlikely(error))
break;
error = do_last(nd, file, op, &opened, pathname);
+ nd->depth--;
put_link(nd);
}
out: