summaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-08-07 17:54:07 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:44 -0400
commit5ba63533bbf653631faab60f6988506160ec6ba4 (patch)
tree8d9ef2670cd3b2f50fe3581820fba5aca365634d /net/wireless/scan.c
parentad5351db89681515681c5d5659ddf4c69e3cc6f5 (diff)
downloadblackbird-op-linux-5ba63533bbf653631faab60f6988506160ec6ba4.tar.gz
blackbird-op-linux-5ba63533bbf653631faab60f6988506160ec6ba4.zip
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/wireless/scan.c')
-rw-r--r--net/wireless/scan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 1bcb1312bd94..e6c1f11595da 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -612,8 +612,8 @@ int cfg80211_wext_siwscan(struct net_device *dev,
creq->wiphy = wiphy;
creq->dev = dev;
- creq->ssids = (void *)(creq + 1);
- creq->channels = (void *)(creq->ssids + 1);
+ /* SSIDs come after channels */
+ creq->ssids = (void *)&creq->channels[n_channels];
creq->n_channels = n_channels;
creq->n_ssids = 1;
OpenPOWER on IntegriCloud