vfs: fix braino resulting in NULL pointer deref in r352424

The breakage was added after all the testing and the testing which followed
was not sufficient to find it.

Reported by:	pho
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mateusz Guzik 2019-09-17 08:09:39 +00:00
parent 9d45af5c09
commit 7f65185940

View File

@ -613,11 +613,13 @@ vop_stdgetwritemount(ap)
vfs_op_thread_exit(mp);
} else {
MNT_ILOCK(mp);
if (mp == vp->v_mount)
if (mp == vp->v_mount) {
MNT_REF(mp);
else
MNT_IUNLOCK(mp);
} else {
MNT_IUNLOCK(mp);
mp = NULL;
MNT_IUNLOCK(mp);
}
}
*(ap->a_mpp) = mp;
return (0);