ath9k: Fix RX crypto processing
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Wed, 14 Aug 2013 03:41:12 +0000 (09:11 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 15 Aug 2013 20:08:02 +0000 (16:08 -0400)
The keymiss events are valid only in the last descriptor
of a packet. Fix this by making sure that we return
early in case of chained descriptors.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/recv.c

index f8cc2b3b38d9105e243f46063f53a433f22d7041..b04a9711eb31465a76b8878cad12bfebf93fddd8 100644 (file)
@@ -785,10 +785,6 @@ static bool ath9k_rx_accept(struct ath_common *common,
            !test_bit(rx_stats->rs_keyix, common->ccmp_keymap))
                rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
 
-       /* Only use error bits from the last fragment */
-       if (rx_stats->rs_more)
-               return true;
-
        mic_error = is_valid_tkip && !ieee80211_is_ctl(fc) &&
                !ieee80211_has_morefrags(fc) &&
                !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) &&
@@ -959,6 +955,10 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
                return -EINVAL;
        }
 
+       /* Only use status info from the last fragment */
+       if (rx_stats->rs_more)
+               return 0;
+
        /*
         * everything but the rate is checked here, the rate check is done
         * separately to avoid doing two lookups for a rate for each frame.
@@ -966,10 +966,6 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
        if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error))
                return -EINVAL;
 
-       /* Only use status info from the last fragment */
-       if (rx_stats->rs_more)
-               return 0;
-
        if (ath9k_process_rate(common, hw, rx_stats, rx_status))
                return -EINVAL;