From owner-svn-src-head@freebsd.org Mon Jul 30 15:15:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE70B105956F; Mon, 30 Jul 2018 15:15:34 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 743C5760E5; Mon, 30 Jul 2018 15:15:34 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5236226080; Mon, 30 Jul 2018 15:15:34 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6UFFYws005175; Mon, 30 Jul 2018 15:15:34 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6UFFYKf005174; Mon, 30 Jul 2018 15:15:34 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201807301515.w6UFFYKf005174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 30 Jul 2018 15:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336911 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 336911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 15:15:34 -0000 Author: jhibbits Date: Mon Jul 30 15:15:33 2018 New Revision: 336911 URL: https://svnweb.freebsd.org/changeset/base/336911 Log: snd_hda: Only free streams DMA maps if the streams list has been created If hdac_attach fails prior to allocating sc->streams, cleanup in the hdac_attach_fail label will dereference a NULL pointer, panicking. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Jul 30 15:10:06 2018 (r336910) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Jul 30 15:15:33 2018 (r336911) @@ -1312,8 +1312,9 @@ hdac_attach(device_t dev) hdac_attach_fail: hdac_irq_free(sc); - for (i = 0; i < sc->num_ss; i++) - hdac_dma_free(sc, &sc->streams[i].bdl); + if (sc->streams != NULL) + for (i = 0; i < sc->num_ss; i++) + hdac_dma_free(sc, &sc->streams[i].bdl); free(sc->streams, M_HDAC); hdac_dma_free(sc, &sc->rirb_dma); hdac_dma_free(sc, &sc->corb_dma);