ath9k: dynack: check da->enabled first in sampling routines
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Fri, 2 Nov 2018 20:49:57 +0000 (21:49 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 6 Nov 2018 16:26:39 +0000 (18:26 +0200)
Check da->enabled flag first in ath_dynack_sample_tx_ts and
ath_dynack_sample_ack_ts routines in order to avoid useless
processing

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/dynack.c

index 5c969d8..5c3b32f 100644 (file)
@@ -178,7 +178,7 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb,
        u32 dur = ts->duration;
        u8 ridx;
 
-       if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled)
+       if (!da->enabled || (info->flags & IEEE80211_TX_CTL_NO_ACK))
                return;
 
        spin_lock_bh(&da->qlock);
@@ -251,7 +251,7 @@ void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb,
        struct ath_common *common = ath9k_hw_common(ah);
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 
-       if (!ath_dynack_bssidmask(ah, hdr->addr1) || !da->enabled)
+       if (!da->enabled || !ath_dynack_bssidmask(ah, hdr->addr1))
                return;
 
        spin_lock_bh(&da->qlock);