The ath9k ANI code may under some circumstances do division-by-zero. This patch detects and avoids that case. Reported-by: Ben Greear <greearb@xxxxxxxxxxxxxxx> Signed-off-by: Björn Smedman <bjorn.smedman@xxxxxxxxxxx> --- 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 /