ath9k: discard undersized packets
authorFelix Fietkau <nbd@nbd.name>
Mon, 22 Jan 2018 06:00:16 +0000 (08:00 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 25 Jan 2018 05:30:49 +0000 (07:30 +0200)
Sometimes the hardware will push small packets that trigger a WARN_ON
in mac80211. Discard them early to avoid this issue.

Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/recv.c

index 2197aee..a8ac42c 100644 (file)
@@ -826,9 +826,9 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
        sc->rx.discard_next = false;
 
        /*
-        * Discard zero-length packets.
+        * Discard zero-length packets and packets smaller than an ACK
         */
-       if (!rx_stats->rs_datalen) {
+       if (rx_stats->rs_datalen < 10) {
                RX_STAT_INC(rx_len_err);
                goto corrupt;
        }