aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-04-26 05:27:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:44 -0400
commit44e1b98f733e48bb781e4229120e1de5e0c9fdbb (patch)
treeea78354841cd6c6ea74e9005343b1119eca6f7be /net/wireless/scan.c
parent273de92c8461776aaac7b32f8d5889a72b38ea10 (diff)
cfg80211: Use the correct IE buffer pointer
If the IE buffer was allocated, the pub.information_elements pointer was also changed to the allocated space. So we must not assume anymore that the pointer points at the "found" tail. So if it was allocated previously, take the codebranch that grows the buffer size (if necessary) and put the data into the allocated buffer. Signed-off-by: Michael Buesch <mb@bu3sch.de> Acked-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 5dd909a4e601..10b4887dfa6b 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -377,7 +377,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
377 size_t used = dev->wiphy.bss_priv_size + sizeof(*res); 377 size_t used = dev->wiphy.bss_priv_size + sizeof(*res);
378 size_t ielen = res->pub.len_information_elements; 378 size_t ielen = res->pub.len_information_elements;
379 379
380 if (ksize(found) >= used + ielen) { 380 if (!found->ies_allocated && ksize(found) >= used + ielen) {
381 memcpy(found->pub.information_elements, 381 memcpy(found->pub.information_elements,
382 res->pub.information_elements, ielen); 382 res->pub.information_elements, ielen);
383 found->pub.len_information_elements = ielen; 383 found->pub.len_information_elements = ielen;