]> xenbits.xensource.com Git - freebsd.git/commitdiff
vfs: restore mp null check in vop_stdgetwritemount
authormjg <mjg@FreeBSD.org>
Mon, 2 Sep 2019 15:24:25 +0000 (15:24 +0000)
committermjg <mjg@FreeBSD.org>
Mon, 2 Sep 2019 15:24:25 +0000 (15:24 +0000)
The initially read mount point can already be NULL.

Reported by: markj
Fixes: r351656 ("vfs: stop refing freed mount points in vop_stdgetwritemount")
Sponsored by: The FreeBSD Foundation

sys/kern/vfs_default.c

index 4c7e8781d1baea1a33f9841881cd5382fa1f10cd..50c5ffb5f2095e28ab1c7429fd87a1ab8449db7a 100644 (file)
@@ -601,6 +601,8 @@ vop_stdgetwritemount(ap)
         */
        vp = ap->a_vp;
        mp = vp->v_mount;
+       if (mp == NULL)
+               goto out;
        MNT_ILOCK(mp);
        if (mp != vp->v_mount) {
                MNT_IUNLOCK(mp);