svn commit: r354101 - stable/12/sys/kern

John Baldwin jhb at FreeBSD.org
Fri Oct 25 21:23:45 UTC 2019


Author: jhb
Date: Fri Oct 25 21:23:44 2019
New Revision: 354101
URL: https://svnweb.freebsd.org/changeset/base/354101

Log:
  MFC 353371: Don't free the cursor boundary tag during vmem_destroy().
  
  The cursor boundary tag is statically allocated in the vmem instead of
  from the vmem_bt_zone.  Explicitly remove it from the vmem's segment
  list in vmem_destroy before freeing all the segments from the vmem.

Modified:
  stable/12/sys/kern/subr_vmem.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/subr_vmem.c
==============================================================================
--- stable/12/sys/kern/subr_vmem.c	Fri Oct 25 21:21:21 2019	(r354100)
+++ stable/12/sys/kern/subr_vmem.c	Fri Oct 25 21:23:44 2019	(r354101)
@@ -466,6 +466,7 @@ static void
 bt_remseg(vmem_t *vm, bt_t *bt)
 {
 
+	MPASS(bt->bt_type != BT_TYPE_CURSOR);
 	TAILQ_REMOVE(&vm->vm_seglist, bt, bt_seglist);
 	bt_free(vm, bt);
 }
@@ -843,6 +844,7 @@ vmem_destroy1(vmem_t *vm)
 	VMEM_LOCK(vm);
 	MPASS(vm->vm_nbusytag == 0);
 
+	TAILQ_REMOVE(&vm->vm_seglist, &vm->vm_cursor, bt_seglist);
 	while ((bt = TAILQ_FIRST(&vm->vm_seglist)) != NULL)
 		bt_remseg(vm, bt);
 


More information about the svn-src-stable-12 mailing list