diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2008-07-11 03:03:08 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2008-07-11 03:03:08 +0000 |
commit | 3b248566c8550bd815500a55565875bc0fe865b5 (patch) | |
tree | 4aaf31b7d3459114f684be003bc499e848b5fbff /sys/arch/i386 | |
parent | 563379b751a4197494e165067734c31e5aef205e (diff) |
initialise the state kept between calls to dmamap_load_buffer to 0. there
was an extremely small chance that random stack garbage coudl be used which
could corrupt a dmamap.
this is the same as the change made to amd64 in
src/sys/arch/amd64/amd64/bus_dma.c r1.10.
ok miod@ kettenis@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 95bd7c28629..63811f1061d 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.434 2008/07/07 13:41:59 jsg Exp $ */ +/* $OpenBSD: machdep.c,v 1.435 2008/07/11 03:03:07 dlg Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -3731,7 +3731,7 @@ int _bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t map, void *buf, bus_size_t buflen, struct proc *p, int flags) { - bus_addr_t lastaddr; + bus_addr_t lastaddr = 0; int seg, error; /* @@ -3760,7 +3760,7 @@ int _bus_dmamap_load_mbuf(bus_dma_tag_t t, bus_dmamap_t map, struct mbuf *m0, int flags) { - paddr_t lastaddr; + paddr_t lastaddr = 0; int seg, error, first; struct mbuf *m; @@ -3802,7 +3802,7 @@ int _bus_dmamap_load_uio(bus_dma_tag_t t, bus_dmamap_t map, struct uio *uio, int flags) { - paddr_t lastaddr; + paddr_t lastaddr = 0; int seg, i, error, first; bus_size_t minlen, resid; struct proc *p = NULL; |