git: f7dc4a71da2c - main - vfs: plug spurious error checks in namei
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 13 Sep 2022 23:18:57 UTC
The branch main has been updated by mjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=f7dc4a71da2c36ae133c640ab5f4268443f49f97
commit f7dc4a71da2c36ae133c640ab5f4268443f49f97
Author: Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-09-13 23:18:30 +0000
Commit: Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-09-13 23:18:30 +0000
vfs: plug spurious error checks in namei
error is guaranteed 0 at that point
---
sys/kern/vfs_lookup.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 20fb63dcee94..4281cd434fcf 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -689,16 +689,15 @@ namei(struct nameidata *ndp)
*/
if ((cnp->cn_flags & ISSYMLINK) == 0) {
SDT_PROBE4(vfs, namei, lookup, return, error,
- (error == 0 ? ndp->ni_vp : NULL), false, ndp);
+ ndp->ni_vp, false, ndp);
if ((cnp->cn_flags & (SAVENAME | SAVESTART)) == 0) {
namei_cleanup_cnp(cnp);
} else
cnp->cn_flags |= HASBUF;
nameicap_cleanup(ndp);
pwd_drop(pwd);
- if (error == 0)
- NDVALIDATE(ndp);
- return (error);
+ NDVALIDATE(ndp);
+ return (0);
}
error = namei_follow_link(ndp);
if (error != 0)