From owner-p4-projects@FreeBSD.ORG Tue Dec 2 01:57:24 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 066A51065670; Tue, 2 Dec 2008 01:57:24 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEF281065679 for ; Tue, 2 Dec 2008 01:57:23 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B84BA8FC1D for ; Tue, 2 Dec 2008 01:57:23 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mB21vNiU061717 for ; Tue, 2 Dec 2008 01:57:23 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mB21vNq5061715 for perforce@freebsd.org; Tue, 2 Dec 2008 01:57:23 GMT (envelope-from sam@freebsd.org) Date: Tue, 2 Dec 2008 01:57:23 GMT Message-Id: <200812020157.mB21vNq5061715@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 153931 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 01:57:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=153931 Change 153931 by sam@sam_ebb on 2008/12/02 01:56:38 o remove two bus_dmamap_destroy calls that were wrong; the memory was allocated with bus_dmamem_alloc and it manages the map so doing the explicit destroy calls resulted in duplicate free o compare ptr against NULL not zero o add comment Affected files ... .. //depot/projects/vap/sys/arm/xscale/ixp425/if_npe.c#7 edit Differences ... ==== //depot/projects/vap/sys/arm/xscale/ixp425/if_npe.c#7 (text+ko) ==== @@ -575,7 +575,6 @@ } bus_dmamap_unload(dma->buf_tag, dma->buf_map); bus_dmamem_free(dma->buf_tag, dma->hwbuf, dma->buf_map); - bus_dmamap_destroy(dma->buf_tag, dma->buf_map); } if (dma->buf != NULL) free(dma->buf, M_TEMP); @@ -870,14 +869,13 @@ bus_dmamap_unload(sc->sc_stats_tag, sc->sc_stats_map); bus_dmamem_free(sc->sc_stats_tag, sc->sc_stats, sc->sc_stats_map); - bus_dmamap_destroy(sc->sc_stats_tag, sc->sc_stats_map); } if (sc->sc_stats_tag != NULL) bus_dma_tag_destroy(sc->sc_stats_tag); npe_dma_destroy(sc, &sc->txdma); npe_dma_destroy(sc, &sc->rxdma); bus_generic_detach(sc->sc_dev); - if (sc->sc_mii) + if (sc->sc_mii != NULL) device_delete_child(sc->sc_dev, sc->sc_mii); #if 0 /* XXX sc_ioh and sc_miih */ @@ -1729,7 +1727,7 @@ struct npe_softc *sc = device_get_softc(dev); uint32_t v; - if (phy != sc->sc_phy) /* XXX */ + if (phy != sc->sc_phy) /* XXX should not happen */ return; v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | data | NPE_MII_WRITE