From owner-svn-src-all@FreeBSD.ORG Mon Jun 23 03:45:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59682EEC; Mon, 23 Jun 2014 03:45:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4714A2713; Mon, 23 Jun 2014 03:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N3jedS063254; Mon, 23 Jun 2014 03:45:40 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N3jeiU063253; Mon, 23 Jun 2014 03:45:40 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201406230345.s5N3jeiU063253@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 23 Jun 2014 03:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267762 - head/sys/dev/sound/pcm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 03:45:40 -0000 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); }