From: mjg Date: Tue, 17 Sep 2019 08:09:39 +0000 (+0000) Subject: vfs: fix braino resulting in NULL pointer deref in r352424 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9757eca049e7f919be04b3dc36c3c4e23e69876a;p=freebsd.git 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 --- diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 163a617a3ec..2fd95fbc8b4 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -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);