From f28fd68f484b4cdee96286cf74a05a7ca5f2cbc5 Mon Sep 17 00:00:00 2001 From: dlg Date: Fri, 11 Jul 2008 03:03:07 +0000 Subject: [PATCH] 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@ --- sys/arch/i386/i386/machdep.c | 8 ++++---- 1 file 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; -- 2.20.1