Don't try to obtain a reference to a nonexisting (NULL) mount structure in

default VOP_GETWRITEMOUNT().
This commit is contained in:
Tor Egge 2006-09-20 00:27:02 +00:00
parent 6508a1ecdc
commit 60b0b1aa18

View file

@ -353,10 +353,12 @@ vop_stdgetwritemount(ap)
* harmful to return with a ref to our previous mountpoint.
*/
mp = ap->a_vp->v_mount;
vfs_ref(mp);
if (mp != ap->a_vp->v_mount) {
vfs_rel(mp);
mp = NULL;
if (mp != NULL) {
vfs_ref(mp);
if (mp != ap->a_vp->v_mount) {
vfs_rel(mp);
mp = NULL;
}
}
*(ap->a_mpp) = mp;
return (0);