From 0da47b2fc6ae9aeaadd3156dd4b3130a7f739ef1 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Sun, 14 Apr 2002 12:39:38 +0000 Subject: Protect the initial list traversal in sysctl_vm_zone() with the uma_mtx. --- sys/vm/uma_core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/vm') diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 100a1ab8a841..a0a4469fee6b 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1947,8 +1947,10 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS) char *p; cnt = 0; + mtx_lock(&uma_mtx); LIST_FOREACH(z, &uma_zones, uz_link) cnt++; + mtx_unlock(&uma_mtx); MALLOC(tmpbuf, char *, (cnt == 0 ? 1 : cnt) * linesize, M_TEMP, M_WAITOK); len = snprintf(tmpbuf, linesize, -- cgit v1.3