Commit 34cee821 authored by John W. Linville's avatar John W. Linville Committed by Greg Kroah-Hartman

ath5k: check return value of ieee80211_get_tx_rate

commit d8e1ba76 upstream.

This avoids a NULL pointer dereference as reported here:

	https://bugzilla.redhat.com/show_bug.cgi?id=625889

When the WARN condition is hit in ieee80211_get_tx_rate, it will return
NULL.  So, we need to check the return value and avoid dereferencing it
in that case.
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Acked-by: default avatarBob Copeland <me@bobcopeland.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8fdd6243
...@@ -1288,6 +1288,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, ...@@ -1288,6 +1288,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
rate = ieee80211_get_tx_rate(sc->hw, info); rate = ieee80211_get_tx_rate(sc->hw, info);
if (!rate) {
ret = -EINVAL;
goto err_unmap;
}
if (info->flags & IEEE80211_TX_CTL_NO_ACK) if (info->flags & IEEE80211_TX_CTL_NO_ACK)
flags |= AR5K_TXDESC_NOACK; flags |= AR5K_TXDESC_NOACK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment