diff options
author | Helmut Schaa <hschaa@suse.de> | 2008-05-20 03:56:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-20 22:40:30 -0400 |
commit | 0d580a774b3682b8b2b5c89ab9b813d149ef28e7 (patch) | |
tree | 21ff9c9354ac7ed73d35fb86062c65d78d8614d7 /net/mac80211 | |
parent | 51e779f0daa5c712439d37b907d58543e4fcf12a (diff) |
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, | |||
730 | if (bss->wmm_ie) { | 730 | if (bss->wmm_ie) { |
731 | wmm = 1; | 731 | wmm = 1; |
732 | } | 732 | } |
733 | |||
734 | /* get all rates supported by the device and the AP as | ||
735 | * some APs don't like getting a superset of their rates | ||
736 | * in the association request (e.g. D-Link DAP 1353 in | ||
737 | * b-only mode) */ | ||
738 | rates_len = ieee80211_compatible_rates(bss, sband, &rates); | ||
739 | |||
733 | ieee80211_rx_bss_put(dev, bss); | 740 | ieee80211_rx_bss_put(dev, bss); |
741 | } else { | ||
742 | rates = ~0; | ||
743 | rates_len = sband->n_bitrates; | ||
734 | } | 744 | } |
735 | 745 | ||
736 | mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); | 746 | mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); |
@@ -761,10 +771,7 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
761 | *pos++ = ifsta->ssid_len; | 771 | *pos++ = ifsta->ssid_len; |
762 | memcpy(pos, ifsta->ssid, ifsta->ssid_len); | 772 | memcpy(pos, ifsta->ssid, ifsta->ssid_len); |
763 | 773 | ||
764 | /* all supported rates should be added here but some APs | 774 | /* add all rates which were marked to be used above */ |
765 | * (e.g. D-Link DAP 1353 in b-only mode) don't like that | ||
766 | * Therefore only add rates the AP supports */ | ||
767 | rates_len = ieee80211_compatible_rates(bss, sband, &rates); | ||
768 | supp_rates_len = rates_len; | 775 | supp_rates_len = rates_len; |
769 | if (supp_rates_len > 8) | 776 | if (supp_rates_len > 8) |
770 | supp_rates_len = 8; | 777 | supp_rates_len = 8; |