Author: mjg
Date: Tue Sep 17 08:09:39 2019
New Revision: 352437
URL: https://svnweb.freebsd.org/changeset/base/352437

Log:
  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

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c Tue Sep 17 06:08:15 2019        (r352436)
+++ head/sys/kern/vfs_default.c Tue Sep 17 08:09:39 2019        (r352437)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to