From a4c2c79097830b0afd3d94ce4759576c9b85cf50 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sun, 24 Apr 2016 01:38:45 +0000 Subject: [PATCH] Zero the newly allocated spinlock. Not sure how this worked testing with DIAGNOSTIC set, but with it disabled this fails due to the spinlock being "initialized" with 0xdeadc0de. --- sys/contrib/ncsw/user/env/xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/ncsw/user/env/xx.c b/sys/contrib/ncsw/user/env/xx.c index 0ca7bc101eac..264f7dba5d62 100644 --- a/sys/contrib/ncsw/user/env/xx.c +++ b/sys/contrib/ncsw/user/env/xx.c @@ -561,7 +561,7 @@ XX_InitSpinlock(void) { struct mtx *m; - m = malloc(sizeof(*m), M_NETCOMMSW, M_NOWAIT); + m = malloc(sizeof(*m), M_NETCOMMSW, M_NOWAIT | M_ZERO); if (!m) return (0);