]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ath9k: Fix a NULL pointer dereference in ath_rate_get
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 17 Dec 2008 11:30:31 +0000 (13:30 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 19 Dec 2008 20:23:44 +0000 (15:23 -0500)
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>
drivers/net/wireless/ath9k/rc.c

index 0ae5988e0b65215e587e9df543508a6149bf81dc..04ab457a8faa3f3bce73692b583a61866c72e6e2 100644 (file)
@@ -1498,7 +1498,8 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
        __le16 fc = hdr->frame_control;
 
        /* lowest rate for management and multicast/broadcast frames */
-       if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1)) {
+       if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) ||
+           !sta) {
                tx_info->control.rates[0].idx = rate_lowest_index(sband, sta);
                tx_info->control.rates[0].count =
                        is_multicast_ether_addr(hdr->addr1) ? 1 : ATH_MGT_TXMAXTRY;