Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sys/dev/pci Pull up following revision(s) (requested by k...



details:   https://anonhg.NetBSD.org/src/rev/17b2d64713de
branches:  netbsd-3
changeset: 578238:17b2d64713de
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Jul 30 17:09:29 2006 +0000

description:
Pull up following revision(s) (requested by kent in ticket #1432):
        sys/dev/pci/azalia_codec.c: revision 1.22
fix crash by reading a mixer value with AD1981HD codec, which
has invalid connection lists.

diffstat:

 sys/dev/pci/azalia_codec.c |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r e1f1a8b5d44a -r 17b2d64713de sys/dev/pci/azalia_codec.c
--- a/sys/dev/pci/azalia_codec.c        Sun Jul 30 17:09:20 2006 +0000
+++ b/sys/dev/pci/azalia_codec.c        Sun Jul 30 17:09:29 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: azalia_codec.c,v 1.4.2.21 2006/07/30 17:09:04 tron Exp $       */
+/*     $NetBSD: azalia_codec.c,v 1.4.2.22 2006/07/30 17:09:29 tron Exp $       */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.4.2.21 2006/07/30 17:09:04 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.4.2.22 2006/07/30 17:09:29 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -924,7 +924,20 @@
                        return err;
                mc->un.value.level[0] = generic_mixer_from_device_value(this,
                    nid, target, CORB_GAGM_GAIN(result));
-               n = this->w[nid].connections[MI_TARGET_INAMP(target)];
+               if (this->w[nid].type == COP_AWTYPE_AUDIO_SELECTOR ||
+                   this->w[nid].type == COP_AWTYPE_AUDIO_MIXER) {
+                       n = this->w[nid].connections[MI_TARGET_INAMP(target)];
+#ifdef AZALIA_DEBUG
+                       if (!VALID_WIDGET_NID(n, this)) {
+                               DPRINTF(("%s: invalid target: nid=%d nconn=%d index=%d\n",
+                                  __func__, nid, this->w[nid].nconnections,
+                                  MI_TARGET_INAMP(target)));
+                               return EINVAL;
+                       }
+#endif
+               } else {
+                       n = nid;
+               }
                mc->un.value.num_channels = WIDGET_CHANNELS(&this->w[n]);
                if (mc->un.value.num_channels == 2) {
                        err = this->comresp(this, nid,



Home | Main Index | Thread Index | Old Index