Skip to content

Commit

Permalink
ath9k: fix null pointer dereference in ani monitor code
Browse files Browse the repository at this point in the history
In 'ath9k_ani_reset' the 'ahp->ah_curani' will be initialized only
if 'DO_ANI(ah)' true. In 'ath9k_hw_ani_monitor' we are using
'ahp->ah_curani' unconditionally, and it will cause a NULL pointer
dereference on AR9100.

Changes-licensed-under: ISC

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Tested-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Gabor Juhos authored and John W. Linville committed Jan 29, 2009
1 parent 1975ef2 commit 9950688
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/ath9k/ani.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,9 @@ void ath9k_hw_ani_monitor(struct ath_hal *ah,
struct ar5416AniState *aniState;
int32_t listenTime;

if (!DO_ANI(ah))
return;

aniState = ahp->ah_curani;
ahp->ah_stats.ast_nodestats = *stats;

Expand Down Expand Up @@ -610,9 +613,6 @@ void ath9k_hw_ani_monitor(struct ath_hal *ah,
aniState->cckPhyErrCount = cckPhyErrCnt;
}

if (!DO_ANI(ah))
return;

if (aniState->listenTime > 5 * ahp->ah_aniPeriod) {
if (aniState->ofdmPhyErrCount <= aniState->listenTime *
aniState->ofdmTrigLow / 1000 &&
Expand Down

0 comments on commit 9950688

Please sign in to comment.