Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jun 2014 03:45:40 +0000 (UTC)
From:      Alexander Kabaev <kan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267762 - head/sys/dev/sound/pcm
Message-ID:  <201406230345.s5N3jeiU063253@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kan
Date: Mon Jun 23 03:45:39 2014
New Revision: 267762
URL: http://svnweb.freebsd.org/changeset/base/267762

Log:
  Restore the check for non-NULL dmatag in sndbuf_free.
  
  The sound drivers that use own buffer management can use sndbuf_setup
  and not do any busdma allocation, so the driver will end up with the
  managed buffer but no valid dma map and tag for it. Avoid calling
  bus_dmamem_free in such cases.
  
  Reported by: ache
  Missed in review by: kan

Modified:
  head/sys/dev/sound/pcm/buffer.c

Modified: head/sys/dev/sound/pcm/buffer.c
==============================================================================
--- head/sys/dev/sound/pcm/buffer.c	Mon Jun 23 02:00:14 2014	(r267761)
+++ head/sys/dev/sound/pcm/buffer.c	Mon Jun 23 03:45:39 2014	(r267762)
@@ -141,7 +141,8 @@ sndbuf_free(struct snd_dbuf *b)
 		if (b->flags & SNDBUF_F_MANAGED) {
 			if (b->buf_addr)
 				bus_dmamap_unload(b->dmatag, b->dmamap);
-			bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
+			if (b->dmatag)
+				bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
 		} else
 			free(b->buf, M_DEVBUF);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406230345.s5N3jeiU063253>