Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0925595 authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville
Browse files

ath9k: Handle corrupt descriptors properly



The MIC/PHYERR/CRC error bits are valid only for
the last desc. for chained packets. Check this early
in the preprocess() routine and bail out.

Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent eb5f952c
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1099,6 +1099,16 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
	if (rx_stats->rs_more)
		return 0;

	/*
	 * Return immediately if the RX descriptor has been marked
	 * as corrupt based on the various error bits.
	 *
	 * This is different from the other corrupt descriptor
	 * condition handled above.
	 */
	if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC)
		return -EINVAL;

	hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len);

	ath9k_process_tsf(rx_stats, rx_status, tsf);
@@ -1335,8 +1345,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
			sc->rx.frag = skb;
			goto requeue;
		}
		if (rs.rs_status & ATH9K_RXERR_CORRUPT_DESC)
			goto requeue_drop_frag;

		if (sc->rx.frag) {
			int space = skb->len - skb_tailroom(hdr_skb);