diff options
author | phk <phk@FreeBSD.org> | 2002-09-28 19:38:29 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-09-28 19:38:29 +0000 |
commit | 45000db18319b1400a31665ae7023cc957602b0f (patch) | |
tree | 75b0194aa00245beb34d4e92e3d9d315be3af473 | |
parent | a88841129cf9273977da53043ddbeb1de0786d01 (diff) | |
download | FreeBSD-src-45000db18319b1400a31665ae7023cc957602b0f.zip FreeBSD-src-45000db18319b1400a31665ae7023cc957602b0f.tar.gz |
Zero the local-variable mutexes before we call mtx_init() on them,
failing to do this may lead mtx_init() to belive they have already
been initialized.
Detected by: Marc Recht <marc@informatik.uni-bremen.de>
-rw-r--r-- | sys/geom/geom_kern.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c index 573e8f8..b3c6f85 100644 --- a/sys/geom/geom_kern.c +++ b/sys/geom/geom_kern.c @@ -83,6 +83,7 @@ g_up_procbody(void) struct thread *tp = FIRST_THREAD_IN_PROC(p); struct mtx mymutex; + bzero(&mymutex, sizeof mymutex); mtx_init(&mymutex, "g_up", MTX_DEF, 0); mtx_lock(&mymutex); tp->td_base_pri = PRIBIO; @@ -107,6 +108,7 @@ g_down_procbody(void) struct thread *tp = FIRST_THREAD_IN_PROC(p); struct mtx mymutex; + bzero(&mymutex, sizeof mymutex); mtx_init(&mymutex, "g_down", MTX_DEF, 0); mtx_lock(&mymutex); tp->td_base_pri = PRIBIO; |