svn commit: r238435 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Sat Jul 14 02:47:17 UTC 2012


Author: adrian
Date: Sat Jul 14 02:47:16 2012
New Revision: 238435
URL: http://svn.freebsd.org/changeset/base/238435

Log:
  Don't free the descriptor allocation/map if it doesn't exist.
  
  I missed this in my previous commit.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Sat Jul 14 02:45:44 2012	(r238434)
+++ head/sys/dev/ath/if_ath.c	Sat Jul 14 02:47:16 2012	(r238435)
@@ -2956,10 +2956,12 @@ ath_descdma_cleanup(struct ath_softc *sc
 	struct ath_buf *bf;
 	struct ieee80211_node *ni;
 
-	bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap);
-	bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap);
-	bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap);
-	bus_dma_tag_destroy(dd->dd_dmat);
+	if (dd->dd_dmamap != 0) {
+		bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap);
+		bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap);
+		bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap);
+		bus_dma_tag_destroy(dd->dd_dmat);
+	}
 
 	TAILQ_FOREACH(bf, head, bf_list) {
 		if (bf->bf_m) {


More information about the svn-src-all mailing list