Module Name:    src
Committed By:   bouyer
Date:           Thu Mar 15 18:49:50 UTC 2012

Modified Files:
        src/sys/external/isc/atheros_hal/dist: ah_eeprom_v4k.c

Log Message:
Use the right marcro for loop bound, avoids read past array end. Found by
gcc -03


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
    src/sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.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/external/isc/atheros_hal/dist/ah_eeprom_v4k.c
diff -u src/sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c:1.1 src/sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c:1.2
--- src/sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c:1.1	Sun Feb 20 11:21:02 2011
+++ src/sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c	Thu Mar 15 18:49:49 2012
@@ -239,7 +239,7 @@ v4kEepromReadCTLInfo(struct ath_hal *ah,
 	HALASSERT(AR5416_4K_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES);
 
 	for (i = 0; ee->ee_base.ctlIndex[i] != 0 && i < AR5416_4K_NUM_CTLS; i++) {
-		for (j = 0; j < NUM_EDGES; j ++) {
+		for (j = 0; j < AR5416_4K_NUM_BAND_EDGES; j ++) {
 			/* XXX Confirm this is the right thing to do when an invalid channel is stored */
 			if (ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) {
 				rep[j].rdEdge = 0;

Reply via email to