summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-01-05 15:03:57 +0000
committerjsing <jsing@openbsd.org>2014-01-05 15:03:57 +0000
commit22f94106475e1c4865b088c6245c92502cc51c9a (patch)
tree3ba887216a00ea4d1d316deff4525bb6e7e7aff2 /sys/dev/softraid.c
parentCleanup some leftovers from previous changes. (diff)
downloadwireguard-openbsd-22f94106475e1c4865b088c6245c92502cc51c9a.tar.xz
wireguard-openbsd-22f94106475e1c4865b088c6245c92502cc51c9a.zip
On some architectures you can get away with using an uninitialised mutex;
this is not the case on hppa (practically the only architecture where unlocked has a non-zero value). This one has been hiding since r1.223... Found the hard way by juanfra@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 3aa4951aa45..f876d755087 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.314 2013/11/19 15:12:13 krw Exp $ */
+/* $OpenBSD: softraid.c,v 1.315 2014/01/05 15:03:57 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -2120,6 +2120,7 @@ sr_wu_alloc(struct sr_discipline *sd)
sd->sd_wu = malloc(sizeof(struct sr_workunit) * no_wu,
M_DEVBUF, M_WAITOK | M_ZERO);
+ mtx_init(&sd->sd_wu_mtx, IPL_BIO);
TAILQ_INIT(&sd->sd_wu_freeq);
TAILQ_INIT(&sd->sd_wu_pendq);
TAILQ_INIT(&sd->sd_wu_defq);
@@ -3466,7 +3467,6 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc,
}
/* Setup SCSI iopool. */
- mtx_init(&sd->sd_wu_mtx, IPL_BIO);
scsi_iopool_init(&sd->sd_iopool, sd, sr_wu_get, sr_wu_put);
/*