ath9k: Fix phyerr debug statistics
Validate the phyerr value against the max. size of the statistics array properly. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
4203214ee2
commit
dbb07f0044
|
@ -987,8 +987,6 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
|
||||||
#define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\
|
#define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\
|
||||||
[sc->debug.rsidx].c)
|
[sc->debug.rsidx].c)
|
||||||
|
|
||||||
u32 phyerr;
|
|
||||||
|
|
||||||
RX_STAT_INC(rx_pkts_all);
|
RX_STAT_INC(rx_pkts_all);
|
||||||
sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen;
|
sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen;
|
||||||
|
|
||||||
|
@ -1007,8 +1005,8 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
|
||||||
|
|
||||||
if (rs->rs_status & ATH9K_RXERR_PHY) {
|
if (rs->rs_status & ATH9K_RXERR_PHY) {
|
||||||
RX_STAT_INC(phy_err);
|
RX_STAT_INC(phy_err);
|
||||||
phyerr = rs->rs_phyerr & 0x24;
|
if (rs->rs_phyerr < ATH9K_PHYERR_MAX)
|
||||||
RX_PHY_ERR_INC(phyerr);
|
RX_PHY_ERR_INC(rs->rs_phyerr);
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->debug.stats.rxstats.rs_rssi_ctl0 = rs->rs_rssi_ctl0;
|
sc->debug.stats.rxstats.rs_rssi_ctl0 = rs->rs_rssi_ctl0;
|
||||||
|
|
Loading…
Reference in New Issue