summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-04-07 02:32:04 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-04-07 02:32:04 +0000
commitbb3ac4e71a7240835ddc3996401765872da9484a (patch)
treee3e42042ecd8436ca7f8fecc4362c88e15e98989 /sys/dev
parente08afd285004110ae16146ef6570bc455cd7fc40 (diff)
david imhoff points out that the error handling in mfi_init_ccb gets the
index to which ccb to free wrong. this takes the logic from mpi/mpii/mfii which pulls the ready ccbs off the free list rather than rely on the current index from the for loop that we failed inside of. thanks to david for finding this out.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/mfi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index 71975b689cc..e2e86392d5d 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.138 2012/09/12 06:53:05 haesbaert Exp $ */
+/* $OpenBSD: mfi.c,v 1.139 2013/04/07 02:32:03 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -289,11 +289,8 @@ mfi_init_ccb(struct mfi_softc *sc)
return (0);
destroy:
/* free dma maps and ccb memory */
- while (i) {
- ccb = &sc->sc_ccb[i];
+ while ((ccb = mfi_get_ccb(sc)) != NULL)
bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap);
- i--;
- }
free(sc->sc_ccb, M_DEVBUF);