summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2013-04-07 02:32:03 +0000
committerdlg <dlg@openbsd.org>2013-04-07 02:32:03 +0000
commite84cb727fcfe3e0da3b8c004df7f471bd4de9a04 (patch)
tree6d9ef20179f6b33324f52fa3a031fd59c81baac2
parentuse -E option for ssh and sshd to write debuging logs to ssh{,d}.log and (diff)
downloadwireguard-openbsd-e84cb727fcfe3e0da3b8c004df7f471bd4de9a04.tar.xz
wireguard-openbsd-e84cb727fcfe3e0da3b8c004df7f471bd4de9a04.zip
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.
-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);