amd64s bus_dma internals use a pointer to a lastaddr variable to keep track of where it was up to when building dmamaps. that lastaddr variable is not initialised every time you start to load a dmamap, so it was using random stack garbage as state when first writing the sg list.
amd64s bus_dma internals use a pointer to a lastaddr variable to keep
track of where it was up to when building dmamaps. that lastaddr variable
is not initialised every time you start to load a dmamap, so it was using
random stack garbage as state when first writing the sg list.

fortunately the way it was used meant it was extremely unlikely to cause a
problem, but why allow even that possibility? this inits lastaddr to 0 in
all the callers of load_buffer.

ok miod@

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars