summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2021-01-09 12:15:49 +0000
committervisa <visa@openbsd.org>2021-01-09 12:15:49 +0000
commitc6a3582c8f2373a9f3d5fd3a36d19bc67496b422 (patch)
treef13e57779cf84df9ff4c219ffb5e27d05d2711ca
parentAdd PerSourceMaxStartups and PerSourceNetBlockSize options which provide (diff)
downloadwireguard-openbsd-c6a3582c8f2373a9f3d5fd3a36d19bc67496b422.tar.xz
wireguard-openbsd-c6a3582c8f2373a9f3d5fd3a36d19bc67496b422.zip
Remove unnecessary relocking of w_mtx as panic() should not return.
-rw-r--r--sys/kern/subr_witness.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 04ac1e4929e..711134a2cd8 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_witness.c,v 1.39 2020/12/07 16:55:29 mpi Exp $ */
+/* $OpenBSD: subr_witness.c,v 1.40 2021/01/09 12:15:49 visa Exp $ */
/*-
* Copyright (c) 2008 Isilon Systems, Inc.
@@ -1622,26 +1622,18 @@ adopt(struct witness *parent, struct witness *child)
static void
itismychild(struct witness *parent, struct witness *child)
{
- int unlocked;
-
KASSERT(child != NULL && parent != NULL);
if (witness_cold == 0)
MUTEX_ASSERT_LOCKED(&w_mtx);
if (!witness_lock_type_equal(parent, child)) {
- if (witness_cold == 0) {
- unlocked = 1;
+ if (witness_cold == 0)
mtx_leave(&w_mtx);
- } else {
- unlocked = 0;
- }
panic(
"%s: parent \"%s\" (%s) and child \"%s\" (%s) are not "
"the same lock type", __func__, parent->w_type->lt_name,
parent->w_class->lc_name, child->w_type->lt_name,
child->w_class->lc_name);
- if (unlocked)
- mtx_enter(&w_mtx);
}
adopt(parent, child);
}