From 22f94106475e1c4865b088c6245c92502cc51c9a Mon Sep 17 00:00:00 2001 From: jsing Date: Sun, 5 Jan 2014 15:03:57 +0000 Subject: [PATCH] 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@ --- sys/dev/softraid.c | 4 ++-- 1 file 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 * Copyright (c) 2008 Chris Kuethe @@ -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); /* -- 2.20.1