diff options
author | tegge <tegge@FreeBSD.org> | 2006-09-20 00:27:02 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2006-09-20 00:27:02 +0000 |
commit | 61b02921e7257ee157305a1de4077daf6b2b56a6 (patch) | |
tree | 23c8b397dff3047fe8210a7d44e457b07b770891 /sys | |
parent | 750ab68ba1f38627cc3a1bdcd64c96b9a5aee0f9 (diff) | |
download | FreeBSD-src-61b02921e7257ee157305a1de4077daf6b2b56a6.zip FreeBSD-src-61b02921e7257ee157305a1de4077daf6b2b56a6.tar.gz |
Don't try to obtain a reference to a nonexisting (NULL) mount structure in
default VOP_GETWRITEMOUNT().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_default.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index bf33115..0232ff3 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -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); |