Module Name:    src
Committed By:   jmcneill
Date:           Sat Aug  7 16:24:19 UTC 2010

Modified Files:
        src/sys/dev/pci/hdaudio: hdaudio.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/hdaudio/hdaudio.c
diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.6 src/sys/dev/pci/hdaudio/hdaudio.c:1.7
--- src/sys/dev/pci/hdaudio/hdaudio.c:1.6	Tue Aug  3 04:02:21 2010
+++ src/sys/dev/pci/hdaudio/hdaudio.c	Sat Aug  7 16:24:19 2010
@@ -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 <[email protected]>
@@ -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,

Reply via email to