aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-02-16 01:22:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:05:43 -0500
commitdbb07f00446f3c7557dbfefb6e16f15b96225da8 (patch)
treedd0ed5b1eb52c09f9202406f678a65bf5b2074f8 /drivers/net/wireless/ath/ath9k/debug.c
parent4203214ee28d285c580263e2ea80848fd5e676f3 (diff)
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>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 5a838fc28b6..228c18189a3 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -987,8 +987,6 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
987#define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\ 987#define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\
988 [sc->debug.rsidx].c) 988 [sc->debug.rsidx].c)
989 989
990 u32 phyerr;
991
992 RX_STAT_INC(rx_pkts_all); 990 RX_STAT_INC(rx_pkts_all);
993 sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen; 991 sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen;
994 992
@@ -1007,8 +1005,8 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
1007 1005
1008 if (rs->rs_status & ATH9K_RXERR_PHY) { 1006 if (rs->rs_status & ATH9K_RXERR_PHY) {
1009 RX_STAT_INC(phy_err); 1007 RX_STAT_INC(phy_err);
1010 phyerr = rs->rs_phyerr & 0x24; 1008 if (rs->rs_phyerr < ATH9K_PHYERR_MAX)
1011 RX_PHY_ERR_INC(phyerr); 1009 RX_PHY_ERR_INC(rs->rs_phyerr);
1012 } 1010 }
1013 1011
1014 sc->debug.stats.rxstats.rs_rssi_ctl0 = rs->rs_rssi_ctl0; 1012 sc->debug.stats.rxstats.rs_rssi_ctl0 = rs->rs_rssi_ctl0;