Source-Changes-HG archive

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

[src/trunk]: src/sys/external/isc/atheros_hal/dist Use the right marcro for l...



details:   https://anonhg.NetBSD.org/src/rev/eb2d167b9b1d
branches:  trunk
changeset: 778093:eb2d167b9b1d
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Mar 15 18:49:49 2012 +0000

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

diffstat:

 sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 0b57ee650bd5 -r eb2d167b9b1d sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c
--- a/sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c Thu Mar 15 18:40:32 2012 +0000
+++ b/sys/external/isc/atheros_hal/dist/ah_eeprom_v4k.c Thu Mar 15 18:49:49 2012 +0000
@@ -239,7 +239,7 @@
        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;



Home | Main Index | Thread Index | Old Index