diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2015-09-18 11:15:21 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2015-09-18 11:15:21 +0000 |
commit | 116645f58b2300fcbca3da8a54f8ff4fb986b679 (patch) | |
tree | 89816fad40bf34a468562dc56cdad4c493a0df84 /sys/arch | |
parent | 2f3d8ead98ffb1e6315b7f4396a2013c6e0591d0 (diff) |
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@
Diffstat (limited to 'sys/arch')
-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: |