diff options
author | Helmut Schaa <hschaa@suse.de> | 2008-05-20 09:56:37 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-20 22:40:30 -0400 |
commit | 0d580a774b3682b8b2b5c89ab9b813d149ef28e7 (patch) | |
tree | 21ff9c9354ac7ed73d35fb86062c65d78d8614d7 /net/mac80211 | |
parent | 51e779f0daa5c712439d37b907d58543e4fcf12a (diff) | |
download | linux-0d580a774b3682b8b2b5c89ab9b813d149ef28e7.tar.gz linux-0d580a774b3682b8b2b5c89ab9b813d149ef28e7.tar.bz2 linux-0d580a774b3682b8b2b5c89ab9b813d149ef28e7.zip |
mac80211: fix NULL pointer dereference in ieee80211_compatible_rates
Fix a possible NULL pointer dereference in ieee80211_compatible_rates
introduced in the patch "mac80211: fix association with some APs". If no bss
is available just use all supported rates in the association request.
Signed-off-by: Helmut Schaa <hschaa@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e470bf12b765..7cfd12e0d1e2 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -730,7 +730,17 @@ static void ieee80211_send_assoc(struct net_device *dev, if (bss->wmm_ie) { wmm = 1; } + + /* get all rates supported by the device and the AP as + * some APs don't like getting a superset of their rates + * in the association request (e.g. D-Link DAP 1353 in + * b-only mode) */ + rates_len = ieee80211_compatible_rates(bss, sband, &rates); + ieee80211_rx_bss_put(dev, bss); + } else { + rates = ~0; + rates_len = sband->n_bitrates; } mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); @@ -761,10 +771,7 @@ static void ieee80211_send_assoc(struct net_device *dev, *pos++ = ifsta->ssid_len; memcpy(pos, ifsta->ssid, ifsta->ssid_len); - /* all supported rates should be added here but some APs - * (e.g. D-Link DAP 1353 in b-only mode) don't like that - * Therefore only add rates the AP supports */ - rates_len = ieee80211_compatible_rates(bss, sband, &rates); + /* add all rates which were marked to be used above */ supp_rates_len = rates_len; if (supp_rates_len > 8) supp_rates_len = 8; |