git: aede6a9670aa - main - vfs: fixup parse_mount_dev_present after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Sat, 17 Sep 2022 10:36:32 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=aede6a9670aae8a6e4b89c520bc0672506c279ba

commit aede6a9670aae8a6e4b89c520bc0672506c279ba
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-09-17 10:35:00 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-09-17 10:35:00 +0000

    vfs: fixup parse_mount_dev_present after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179
    
    Reported by:    kib
---
 sys/kern/vfs_mountroot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c
index 1cf5efb6e57e..ac0cec44f802 100644
--- a/sys/kern/vfs_mountroot.c
+++ b/sys/kern/vfs_mountroot.c
@@ -726,9 +726,10 @@ parse_mount_dev_present(const char *dev)
 
 	NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, dev);
 	error = namei(&nd);
-	if (!error)
+	if (!error) {
 		vput(nd.ni_vp);
-	NDFREE_PNBUF(&nd);
+		NDFREE_PNBUF(&nd);
+	}
 	return (error != 0) ? 0 : 1;
 }