diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2008-12-17 06:30:31 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-19 15:23:44 -0500 |
commit | f66000f7a39769b0ce2355fca13c40ac2f1c39db (patch) | |
tree | 5c23d21f5d54d90be8545c59f627e2448d3478dd | |
parent | 91f39e8eea725347b6a82d1e35e512ec8b298b0b (diff) |
ath9k: Fix a NULL pointer dereference in ath_rate_get
It looks like mac80211 may try to send unicast frames to a STA that
does not have a STA entry. We need to make sure that that is caught in
the rate control code before dereferencing STA data.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index 0ae5988e0b65..04ab457a8faa 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -1498,7 +1498,8 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
1498 | __le16 fc = hdr->frame_control; | 1498 | __le16 fc = hdr->frame_control; |
1499 | 1499 | ||
1500 | /* lowest rate for management and multicast/broadcast frames */ | 1500 | /* lowest rate for management and multicast/broadcast frames */ |
1501 | if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1)) { | 1501 | if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) || |
1502 | !sta) { | ||
1502 | tx_info->control.rates[0].idx = rate_lowest_index(sband, sta); | 1503 | tx_info->control.rates[0].idx = rate_lowest_index(sband, sta); |
1503 | tx_info->control.rates[0].count = | 1504 | tx_info->control.rates[0].count = |
1504 | is_multicast_ether_addr(hdr->addr1) ? 1 : ATH_MGT_TXMAXTRY; | 1505 | is_multicast_ether_addr(hdr->addr1) ? 1 : ATH_MGT_TXMAXTRY; |