Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/hdaudio Reject invalid vendor IDs (say if there ...



details:   https://anonhg.NetBSD.org/src/rev/6029d768b311
branches:  trunk
changeset: 756906:6029d768b311
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Aug 07 16:24:19 2010 +0000

description:
Reject invalid vendor IDs (say if there was a RIRB timeout while reading the
VID registers)

diffstat:

 sys/dev/pci/hdaudio/hdaudio.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 9d653afeb63f -r 6029d768b311 sys/dev/pci/hdaudio/hdaudio.c
--- a/sys/dev/pci/hdaudio/hdaudio.c     Sat Aug 07 16:15:47 2010 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio.c     Sat Aug 07 16:24:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.6 2010/08/03 04:02:21 jakllsch Exp $ */
+/* $NetBSD: hdaudio.c,v 1.7 2010/08/07 16:24:19 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.6 2010/08/03 04:02:21 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.7 2010/08/07 16:24:19 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -668,6 +668,10 @@
        snc = hdaudio_command(co, 0, CORB_GET_PARAMETER,
            COP_SUBORDINATE_NODE_COUNT);
 
+       /* make sure the vendor and product IDs are valid */
+       if (vid == 0xffffffff || vid == 0x00000000)
+               return;
+
 #ifdef HDAUDIO_DEBUG
        hda_print(sc, "Codec%02X: %04X:%04X HDA %d.%d rev %d stepping %d\n",
            co->co_addr, vid >> 16, vid & 0xffff,



Home | Main Index | Thread Index | Old Index