diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-08-07 11:54:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:44 -0400 |
commit | 5ba63533bbf653631faab60f6988506160ec6ba4 (patch) | |
tree | 8d9ef2670cd3b2f50fe3581820fba5aca365634d /net/mac80211/scan.c | |
parent | ad5351db89681515681c5d5659ddf4c69e3cc6f5 (diff) |
cfg80211: fix alignment problem in scan request
The memory layout for scan requests was rather wrong,
we put the scan SSIDs before the channels which could
lead to the channel pointers being unaligned in memory.
It turns out that using a pointer to the channel array
isn't necessary anyway since we can embed a zero-length
array into the struct.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 244f53f3c8b4..e091cbc3434f 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -277,7 +277,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) | |||
277 | if (test_bit(SCAN_HW_SCANNING, &local->scanning)) | 277 | if (test_bit(SCAN_HW_SCANNING, &local->scanning)) |
278 | ieee80211_restore_scan_ies(local); | 278 | ieee80211_restore_scan_ies(local); |
279 | 279 | ||
280 | if (local->scan_req != &local->int_scan_req) | 280 | if (local->scan_req != local->int_scan_req) |
281 | cfg80211_scan_done(local->scan_req, aborted); | 281 | cfg80211_scan_done(local->scan_req, aborted); |
282 | local->scan_req = NULL; | 282 | local->scan_req = NULL; |
283 | 283 | ||
@@ -423,7 +423,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, | |||
423 | local->scan_req = req; | 423 | local->scan_req = req; |
424 | local->scan_sdata = sdata; | 424 | local->scan_sdata = sdata; |
425 | 425 | ||
426 | if (req != &local->int_scan_req && | 426 | if (req != local->int_scan_req && |
427 | sdata->vif.type == NL80211_IFTYPE_STATION && | 427 | sdata->vif.type == NL80211_IFTYPE_STATION && |
428 | !list_empty(&ifmgd->work_list)) { | 428 | !list_empty(&ifmgd->work_list)) { |
429 | /* actually wait for the work it's doing to finish/time out */ | 429 | /* actually wait for the work it's doing to finish/time out */ |
@@ -743,10 +743,10 @@ int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, | |||
743 | if (local->scan_req) | 743 | if (local->scan_req) |
744 | goto unlock; | 744 | goto unlock; |
745 | 745 | ||
746 | memcpy(local->int_scan_req.ssids[0].ssid, ssid, IEEE80211_MAX_SSID_LEN); | 746 | memcpy(local->int_scan_req->ssids[0].ssid, ssid, IEEE80211_MAX_SSID_LEN); |
747 | local->int_scan_req.ssids[0].ssid_len = ssid_len; | 747 | local->int_scan_req->ssids[0].ssid_len = ssid_len; |
748 | 748 | ||
749 | ret = __ieee80211_start_scan(sdata, &sdata->local->int_scan_req); | 749 | ret = __ieee80211_start_scan(sdata, sdata->local->int_scan_req); |
750 | unlock: | 750 | unlock: |
751 | mutex_unlock(&local->scan_mtx); | 751 | mutex_unlock(&local->scan_mtx); |
752 | return ret; | 752 | return ret; |