From d6c3ef56b493885b4c8f2fbb3d60ab7def88fe8a Mon Sep 17 00:00:00 2001 From: bouyer Date: Wed, 25 Aug 1999 17:08:20 +0000 Subject: [PATCH] Guard pool_get()/pool_put() with splbio()/splx(). Fix kern/8245. --- sys/dev/ic/wdc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 5cad6b42d29d..e2e44eb80ad4 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.71 1999/08/09 09:55:18 bouyer Exp $ */ +/* $NetBSD: wdc.c,v 1.72 1999/08/25 17:08:20 bouyer Exp $ */ /* @@ -1281,9 +1281,12 @@ wdc_get_xfer(flags) int flags; { struct wdc_xfer *xfer; + int s; + s = splbio(); xfer = pool_get(&wdc_xfer_pool, ((flags & WDC_NOSLEEP) != 0 ? PR_NOWAIT : PR_WAITOK)); + splx(s); memset(xfer, 0, sizeof(struct wdc_xfer)); return xfer; } @@ -1301,8 +1304,8 @@ wdc_free_xfer(chp, xfer) s = splbio(); chp->ch_flags &= ~WDCF_ACTIVE; TAILQ_REMOVE(&chp->ch_queue->sc_xfer, xfer, c_xferchain); - splx(s); pool_put(&wdc_xfer_pool, xfer); + splx(s); } static void