summaryrefslogtreecommitdiffstats
path: root/sys/dev/pst/pst-raid.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-04-02 11:36:43 +0000
committersos <sos@FreeBSD.org>2003-04-02 11:36:43 +0000
commit00d382d396e35ed2480ef4780a7476d429de40e3 (patch)
tree3ec46a1c293844bdbabf435d1c3a233b38deff2f /sys/dev/pst/pst-raid.c
parentbd1430b43c24ee1e395fa21c3972dff0cb2c1fbf (diff)
downloadFreeBSD-src-00d382d396e35ed2480ef4780a7476d429de40e3.zip
FreeBSD-src-00d382d396e35ed2480ef4780a7476d429de40e3.tar.gz
Instead of not grapping a request binfinish(ENOMEM) it if malloc fails.
Diffstat (limited to 'sys/dev/pst/pst-raid.c')
-rw-r--r--sys/dev/pst/pst-raid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pst/pst-raid.c b/sys/dev/pst/pst-raid.c
index cb6be12..b7c96de 100644
--- a/sys/dev/pst/pst-raid.c
+++ b/sys/dev/pst/pst-raid.c
@@ -215,9 +215,11 @@ pst_start(struct pst_softc *psc)
if (psc->outstanding < (I2O_IOP_OUTBOUND_FRAME_COUNT - 1) &&
(bp = bioq_first(&psc->queue))) {
if ((mfa = iop_get_mfa(psc->iop)) != 0xffffffff) {
+ bioq_remove(&psc->queue, bp);
if (!(request = malloc(sizeof(struct pst_request),
M_PSTRAID, M_NOWAIT | M_ZERO))) {
printf("pst: out of memory in start\n");
+ biofinish(request->bp, NULL, ENOMEM);
iop_free_mfa(psc->iop, mfa);
return;
}
@@ -230,7 +232,6 @@ pst_start(struct pst_softc *psc)
else
request->timeout_handle =
timeout((timeout_t*)pst_timeout, request, 10 * hz);
- bioq_remove(&psc->queue, bp);
if (pst_rw(request)) {
biofinish(request->bp, NULL, EIO);
iop_free_mfa(request->psc->iop, request->mfa);
OpenPOWER on IntegriCloud