[package] kernel: added GPIO driver for CS5535/CS5536 companion chip. Thanks Markus...
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 412-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch
1 From e5d00646a207c4e9da254283eee2d278de338394 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Fri, 2 Jan 2009 16:17:25 +0100
4 Subject: [RFC 12/12] ath9k: fix null pointer dereference in ani monitor code
5
6 In 'ath9k_ani_reset' the 'ahp->ah_curani' will be initialized only
7 if 'DO_ANI(ah)' true. In 'ath9k_hw_ani_monitor' we are using 'ahp->ah_curani'
8 unconditionally, and it will cause a NULL pointer dereference on AR9100.
9
10 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
11 Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
12 ---
13 drivers/net/wireless/ath9k/ani.c | 6 +++---
14 1 files changed, 3 insertions(+), 3 deletions(-)
15
16 --- a/drivers/net/wireless/ath9k/ani.c
17 +++ b/drivers/net/wireless/ath9k/ani.c
18 @@ -555,6 +555,9 @@ void ath9k_hw_ani_monitor(struct ath_hal
19 struct ar5416AniState *aniState;
20 int32_t listenTime;
21
22 + if (!DO_ANI(ah))
23 + return;
24 +
25 aniState = ahp->ah_curani;
26 ahp->ah_stats.ast_nodestats = *stats;
27
28 @@ -614,9 +617,6 @@ void ath9k_hw_ani_monitor(struct ath_hal
29 aniState->cckPhyErrCount = cckPhyErrCnt;
30 }
31
32 - if (!DO_ANI(ah))
33 - return;
34 -
35 if (aniState->listenTime > 5 * ahp->ah_aniPeriod) {
36 if (aniState->ofdmPhyErrCount <= aniState->listenTime *
37 aniState->ofdmTrigLow / 1000 &&