From 1e5f4b12257797b7c33c6668fcbd970c836e9c4b Mon Sep 17 00:00:00 2001 From: visa Date: Mon, 5 Dec 2022 08:58:49 +0000 Subject: [PATCH] Avoid event counter re-insert in evcount_percpu() This fixes evcount_list corruption that happened when evcount_percpu() was called after evcount_init_percpu(). OK jca@ cheloha@ jmatthew@ --- sys/kern/subr_evcount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/subr_evcount.c b/sys/kern/subr_evcount.c index cc9fc58890c..c77c953630d 100644 --- a/sys/kern/subr_evcount.c +++ b/sys/kern/subr_evcount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_evcount.c,v 1.14 2022/11/10 07:05:41 jmatthew Exp $ */ +/* $OpenBSD: subr_evcount.c,v 1.15 2022/12/05 08:58:49 visa Exp $ */ /* * Copyright (c) 2004 Artur Grabowski * Copyright (c) 2004 Aaron Campbell @@ -56,7 +56,6 @@ evcount_percpu(struct evcount *ec) TAILQ_INSERT_TAIL(&evcount_percpu_init_list, ec, next); } else { ec->ec_percpu = counters_alloc(1); - TAILQ_INSERT_TAIL(&evcount_list, ec, next); } } -- 2.20.1