ath10k: check for encryption before adding MIC_LEN
authorBob Copeland <me@bobcopeland.com>
Wed, 9 Sep 2015 16:47:35 +0000 (12:47 -0400)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 17 Sep 2015 10:48:41 +0000 (13:48 +0300)
In the case of raw mode without nohwcrypt parameter, we
should still make sure the frame is protected before
adding MIC_LEN to avoid skb_under_panic errors.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/htt_tx.c

index ea53c215112241302962464c7926088b0b20d178..eb5ba9bb8b4db5d41a2eabe13a9d1ad0cbd5ff95 100644 (file)
@@ -564,7 +564,8 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
             ieee80211_has_protected(hdr->frame_control)) {
                skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
        } else if (!skb_cb->htt.nohwcrypt &&
-                  skb_cb->txmode == ATH10K_HW_TXRX_RAW) {
+                  skb_cb->txmode == ATH10K_HW_TXRX_RAW &&
+                  ieee80211_has_protected(hdr->frame_control)) {
                skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
        }