Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2008 21:42:21 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r183810 - head/sys/dev/sound/pci/hda
Message-ID:  <200810122142.m9CLgLaj056258@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Oct 12 21:42:21 2008
New Revision: 183810
URL: http://svn.freebsd.org/changeset/base/183810

Log:
  Fix bug in a second call of the channel allocation function.
  This should fix crash on systems where two audio codecs connected
  to the same HDA bus.

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	Sun Oct 12 20:06:59 2008	(r183809)
+++ head/sys/dev/sound/pci/hda/hdac.c	Sun Oct 12 21:42:21 2008	(r183810)
@@ -4945,7 +4945,7 @@ hdac_audio_bind_as(struct hdac_devinfo *
 		}
 	} else {
 		sc->chans = (struct hdac_chan *)realloc(sc->chans, 
-		    sizeof(struct hdac_chan) * cnt,
+		    sizeof(struct hdac_chan) * (sc->num_chans + cnt),
 		    M_HDAC, M_ZERO | M_NOWAIT);
 		if (sc->chans == NULL) {
 			sc->num_chans = 0;
@@ -4963,7 +4963,6 @@ hdac_audio_bind_as(struct hdac_devinfo *
 	}
 
 	/* Assign associations in order of their numbers, */
-	free = 0;
 	for (j = 0; j < devinfo->function.audio.ascnt; j++) {
 		if (as[j].enable == 0)
 			continue;



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