summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-08-06 15:40:41 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-08-06 15:40:41 +0000
commit6aebb751e87e2afa785724f1576c7fc3cf9fd952 (patch)
treed61a272cf381f7dfbb0e05d115f55fc4e08d873b /sys
parentbe3eec44f2394ebbf5b927c1a4d43236bc599b2d (diff)
Correct some dma cleanup error paths.
While the index variables were correct the arrays of dma handles they indexed were swapped for rx and tx. As there are a mismatched number of rx and tx descriptors we'd walk off the end of the rx handle array by 30 items. ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/vax/if/if_qe.c10
-rw-r--r--sys/arch/vax/if/sgec.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/arch/vax/if/if_qe.c b/sys/arch/vax/if/if_qe.c
index b413c2ec7cf..3af9c498e45 100644
--- a/sys/arch/vax/if/if_qe.c
+++ b/sys/arch/vax/if/if_qe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_qe.c,v 1.27 2014/07/12 18:44:43 tedu Exp $ */
+/* $OpenBSD: if_qe.c,v 1.28 2014/08/06 15:40:40 jsg Exp $ */
/* $NetBSD: if_qe.c,v 1.51 2002/06/08 12:28:37 ragge Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -345,13 +345,13 @@ qeattach(struct device *parent, struct device *self, void *aux)
}
fail_5:
for (i = 0; i < RXDESCS; i++) {
- if (sc->sc_xmtmap[i] != NULL)
- bus_dmamap_destroy(sc->sc_dmat, sc->sc_xmtmap[i]);
+ if (sc->sc_rcvmap[i] != NULL)
+ bus_dmamap_destroy(sc->sc_dmat, sc->sc_rcvmap[i]);
}
fail_4:
for (i = 0; i < TXDESCS; i++) {
- if (sc->sc_rcvmap[i] != NULL)
- bus_dmamap_destroy(sc->sc_dmat, sc->sc_rcvmap[i]);
+ if (sc->sc_xmtmap[i] != NULL)
+ bus_dmamap_destroy(sc->sc_dmat, sc->sc_xmtmap[i]);
}
}
diff --git a/sys/arch/vax/if/sgec.c b/sys/arch/vax/if/sgec.c
index d0c2cb99237..db7e580789c 100644
--- a/sys/arch/vax/if/sgec.c
+++ b/sys/arch/vax/if/sgec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgec.c,v 1.22 2014/06/13 21:06:24 miod Exp $ */
+/* $OpenBSD: sgec.c,v 1.23 2014/08/06 15:40:40 jsg Exp $ */
/* $NetBSD: sgec.c,v 1.5 2000/06/04 02:14:14 matt Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -240,13 +240,13 @@ sgec_attach(sc)
}
fail_5:
for (i = 0; i < RXDESCS; i++) {
- if (sc->sc_xmtmap[i] != NULL)
- bus_dmamap_destroy(sc->sc_dmat, sc->sc_xmtmap[i]);
+ if (sc->sc_rcvmap[i] != NULL)
+ bus_dmamap_destroy(sc->sc_dmat, sc->sc_rcvmap[i]);
}
fail_4:
for (i = 0; i < TXDESCS; i++) {
- if (sc->sc_rcvmap[i] != NULL)
- bus_dmamap_destroy(sc->sc_dmat, sc->sc_rcvmap[i]);
+ if (sc->sc_xmtmap[i] != NULL)
+ bus_dmamap_destroy(sc->sc_dmat, sc->sc_xmtmap[i]);
}
bus_dmamap_unload(sc->sc_dmat, sc->sc_cmap);
fail_3: