diff options
author | 2015-09-18 11:15:20 +0000 | |
---|---|---|
committer | 2015-09-18 11:15:20 +0000 | |
commit | 962817f7c33da948d88d8449513cf233d14c1e53 (patch) | |
tree | 232f8cf14a6922b47fcac5e644820dabfbd640f9 | |
parent | More dead code. (diff) | |
download | wireguard-openbsd-962817f7c33da948d88d8449513cf233d14c1e53.tar.xz wireguard-openbsd-962817f7c33da948d88d8449513cf233d14c1e53.zip |
Fix an uninitialized variable found by Maxime Villard's Brainy.
While here, fix the size parameter of bus_dmamem_unmap() in
iec_alloc_physical().
ok miod@
-rw-r--r-- | sys/arch/sgi/dev/if_iec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/sgi/dev/if_iec.c b/sys/arch/sgi/dev/if_iec.c index 6a66bf32e45..1416c321a80 100644 --- a/sys/arch/sgi/dev/if_iec.c +++ b/sys/arch/sgi/dev/if_iec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iec.c,v 1.14 2015/06/24 09:40:53 mpi Exp $ */ +/* $OpenBSD: if_iec.c,v 1.15 2015/09/18 11:15:20 visa Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -318,7 +318,7 @@ iec_attach(struct device *parent, struct device *self, void *aux) bus_dma_segment_t seg1; bus_dma_segment_t seg2; bus_size_t control_size; - int i, rc, rseg; + int i, rc; sc->sc_st = iaa->iaa_memt; sc->sc_sh = iaa->iaa_memh; @@ -435,13 +435,13 @@ fail_4: bus_dmamap_destroy(sc->sc_dmat, sc->sc_cddmamap); bus_dmamem_unmap(sc->sc_dmat, (caddr_t)sc->sc_control_data, control_size); - bus_dmamem_free(sc->sc_dmat, &seg2, rseg); + bus_dmamem_free(sc->sc_dmat, &seg2, 1); fail_1: bus_dmamap_unload(sc->sc_dmat, sc->sc_rxarrmap); bus_dmamap_destroy(sc->sc_dmat, sc->sc_rxarrmap); bus_dmamem_unmap(sc->sc_dmat, (caddr_t)sc->sc_rxarr, IEC_NRXDESC_MAX * sizeof(uint64_t)); - bus_dmamem_free(sc->sc_dmat, &seg1, rseg); + bus_dmamem_free(sc->sc_dmat, &seg1, 1); } /* @@ -493,7 +493,7 @@ iec_alloc_physical(struct iec_softc *sc, bus_dmamap_t *dmamap, fail4: bus_dmamap_destroy(sc->sc_dmat, *dmamap); fail3: - bus_dmamem_unmap(sc->sc_dmat, (caddr_t)*va, PAGE_SIZE); + bus_dmamem_unmap(sc->sc_dmat, (caddr_t)*va, len); fail2: bus_dmamem_free(sc->sc_dmat, dmaseg, 1); fail1: |