The ath9k ANI code may under some circumstances do division-by-zero. This
patch detects and avoids that case.
Reported-by: Ben Greear <[email protected]>
Signed-off-by: Bj?rn Smedman <[email protected]>
---
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 3aa8fb1..50a7f89 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -713,6 +713,9 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
ath9k_hw_ani_read_counters(ah);
+ if (WARN_ON(aniState->listenTime == 0))
+ return;
+
ofdmPhyErrRate = aniState->ofdmPhyErrCount * 1000 /
aniState->listenTime;
cckPhyErrRate = aniState->cckPhyErrCount * 1000 /
2010/10/15 Felix Fietkau <[email protected]>:
> On 2010-10-15 2:00 AM, Bj?rn Smedman wrote:
>> The ath9k ANI code may under some circumstances do division-by-zero. This
>> patch detects and avoids that case.
> Should be obsolete with my patch from 3 days ago:
> [PATCH 1/3] ath9k_hw: fix division by zero in the ANI monitor code
Yes it is. Thanks for catching and sorry for the wasted bandwidth.
/Bj?rn
On 2010-10-15 2:00 AM, Bj?rn Smedman wrote:
> The ath9k ANI code may under some circumstances do division-by-zero. This
> patch detects and avoids that case.
Should be obsolete with my patch from 3 days ago:
[PATCH 1/3] ath9k_hw: fix division by zero in the ANI monitor code
- Felix