--- a/sys/dev/netif/ath/ath_hal/ar5212/ar2316.c 2026-09-22 16:03:01.365463540 +0000 +++ b/sys/dev/netif/ath/ath_hal/ar5212/ar2316.c 2026-09-22 16:03:01.389463221 +0000 @@ -424,6 +424,19 @@ /* if this pdGain is used */ } + if (numPdGainsUsed == 0) { + /* + * EEPROM supplied no pd gain data for this channel + * (e.g. xpd_mask == 0 => every numVpd == 0). Bail out: + * continuing would read pPdGainBoundaries[ii-1] and + * pPDADCValues[kk-1] with ii == kk == 0 (uint32 wrap to + * 0xFFFFFFFF => read at array + 0x1FFFFFFFE bytes) plus + * the uninitialized Pmin_t2[0] below. + */ + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: no pd gain data\n", __func__); + return 0; + } + *pMinCalPower = Pmin_t2[0]; kk = 0; /* index for the final table */ for (ii = 0; ii < numPdGainsUsed; ii++) { @@ -535,6 +548,8 @@ numPdGainsUsed = ar2316getGainBoundariesAndPdadcsForPowers(ah, chan->channel, pRawDataset, pdGainOverlap_t2, &minCalPower2316_t2,gainBoundaries, rfXpdGain, pdadcValues); + if (numPdGainsUsed == 0) + return AH_FALSE; HALASSERT(1 <= numPdGainsUsed && numPdGainsUsed <= 3); #ifdef AH_USE_INIPDGAIN