ath9k: fix access to a freed skb in ath_rx_tasklet()
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
c6dbe17f19
commit
853da11b94
@@ -493,6 +493,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
|
|||||||
int hdrlen, padsize, retval;
|
int hdrlen, padsize, retval;
|
||||||
bool decrypt_error = false;
|
bool decrypt_error = false;
|
||||||
u8 keyix;
|
u8 keyix;
|
||||||
|
__le16 fc;
|
||||||
|
|
||||||
spin_lock_bh(&sc->rx.rxbuflock);
|
spin_lock_bh(&sc->rx.rxbuflock);
|
||||||
|
|
||||||
@@ -606,6 +607,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
|
|||||||
/* see if any padding is done by the hw and remove it */
|
/* see if any padding is done by the hw and remove it */
|
||||||
hdr = (struct ieee80211_hdr *)skb->data;
|
hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
hdrlen = ieee80211_get_hdrlen_from_skb(skb);
|
hdrlen = ieee80211_get_hdrlen_from_skb(skb);
|
||||||
|
fc = hdr->frame_control;
|
||||||
|
|
||||||
/* The MAC header is padded to have 32-bit boundary if the
|
/* The MAC header is padded to have 32-bit boundary if the
|
||||||
* packet payload is non-zero. The general calculation for
|
* packet payload is non-zero. The general calculation for
|
||||||
@@ -690,7 +692,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
|
|||||||
sc->rx.rxotherant = 0;
|
sc->rx.rxotherant = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ieee80211_is_beacon(hdr->frame_control) &&
|
if (ieee80211_is_beacon(fc) &&
|
||||||
(sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) {
|
(sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) {
|
||||||
sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON;
|
sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON;
|
||||||
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
|
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
|
||||||
|
Reference in New Issue
Block a user