Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Fix LOCKDEBUG panic on mutex_init().
details: https://anonhg.NetBSD.org/src/rev/fe831d861921
branches: trunk
changeset: 466325:fe831d861921
user: ad <ad%NetBSD.org@localhost>
date: Tue Dec 17 18:08:15 2019 +0000
description:
Fix LOCKDEBUG panic on mutex_init().
Reported-by: syzbot+5a77339dc0a55e8d8caa%syzkaller.appspotmail.com@localhost
diffstat:
sys/kern/kern_sleepq.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r 1312718eba57 -r fe831d861921 sys/kern/kern_sleepq.c
--- a/sys/kern/kern_sleepq.c Tue Dec 17 17:51:12 2019 +0000
+++ b/sys/kern/kern_sleepq.c Tue Dec 17 18:08:15 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sleepq.c,v 1.55 2019/12/16 19:43:36 ad Exp $ */
+/* $NetBSD: kern_sleepq.c,v 1.56 2019/12/17 18:08:15 ad Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.55 2019/12/16 19:43:36 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.56 2019/12/17 18:08:15 ad Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -76,12 +76,17 @@
void
sleeptab_init(sleeptab_t *st)
{
+ static bool again;
int i;
for (i = 0; i < SLEEPTAB_HASH_SIZE; i++) {
- mutex_init(&sleepq_locks[i].lock, MUTEX_DEFAULT, IPL_SCHED);
+ if (!again) {
+ mutex_init(&sleepq_locks[i].lock, MUTEX_DEFAULT,
+ IPL_SCHED);
+ }
sleepq_init(&st->st_queue[i]);
}
+ again = true;
}
/*
Home |
Main Index |
Thread Index |
Old Index