DF-4622 / fix.diff
--- a/sys/dev/netif/ath/ath_hal/ar5212/ar5413.c +++ b/sys/dev/netif/ath/ath_hal/ar5212/ar5413.c @@ -514,6 +514,15 @@ sizeCurrVpdTable = Pmax_t2[ii] - Pmin_t2[ii]; tgtIndex = pPdGainBoundaries[ii] + pdGainOverlap_t2 - Pmin_t2[ii]; + /* + * A flat (or single-step) EEPROM power curve for this + * pdGain makes sizeCurrVpdTable 0 (or 1); the reads + * VpdTable_I[ii][sizeCurrVpdTable-1/-2] below would wrap + * the uint32 index to 0xFFFFFFFF/0xFFFFFFFE and read at + * row + 0x1FFFFFFFE bytes. Clamp to keep them in-row. + */ + if (sizeCurrVpdTable < 2) + sizeCurrVpdTable = 2; maxIndex = (tgtIndex < sizeCurrVpdTable) ? tgtIndex : sizeCurrVpdTable; while (ss < (int16_t)maxIndex && kk < PWR_TABLE_SIZE_2413) |