svn commit: r185176 - head/sys/dev/sound/pci/hda

Alexander Motin mav at FreeBSD.org
Sat Nov 22 06:48:40 PST 2008


Author: mav
Date: Sat Nov 22 14:48:40 2008
New Revision: 185176
URL: http://svn.freebsd.org/changeset/base/185176

Log:
  Change check order to avoid array overrun.
  
  Found with:	Coverity Prevent(tm)
  CID:		2497

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	Sat Nov 22 14:24:55 2008	(r185175)
+++ head/sys/dev/sound/pci/hda/hdac.c	Sat Nov 22 14:48:40 2008	(r185176)
@@ -83,7 +83,7 @@
 
 #include "mixer_if.h"
 
-#define HDA_DRV_TEST_REV	"20081115_0116"
+#define HDA_DRV_TEST_REV	"20081122_0117"
 
 SND_DECLARE_FILE("$FreeBSD$");
 
@@ -4762,7 +4762,7 @@ hdac_audio_trace_as_out(struct hdac_devi
 	nid_t min, res;
 
 	/* Find next pin */
-	for (i = seq; ases[as].pins[i] == 0 && i < 16; i++)
+	for (i = seq; i < 16 && ases[as].pins[i] == 0; i++)
 		;
 	/* Check if there is no any left. If so - we succeded. */
 	if (i == 16)


More information about the svn-src-all mailing list