aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-05-08 15:46:17 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-08 15:46:17 -0400
commita8679be2073392cf22a910bc25da0c7d36459845 (patch)
tree0d25750ea4ba3a85fe683f285261083d77080976 /net/wireless/scan.c
parent22f6dacdfcfdc792d068e9c41234808860498d04 (diff)
parent9dfd6ba353b993d648dcda72480c7ce92cd27c7e (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r--net/wireless/scan.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index dfb53d19fd77..df59440290e5 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -377,18 +377,16 @@ 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;
384 } else { 384 } else {
385 u8 *ies = found->pub.information_elements; 385 u8 *ies = found->pub.information_elements;
386 386
387 if (found->ies_allocated) { 387 if (found->ies_allocated)
388 if (ksize(ies) < ielen) 388 ies = krealloc(ies, ielen, GFP_ATOMIC);
389 ies = krealloc(ies, ielen, 389 else
390 GFP_ATOMIC);
391 } else
392 ies = kmalloc(ielen, GFP_ATOMIC); 390 ies = kmalloc(ielen, GFP_ATOMIC);
393 391
394 if (ies) { 392 if (ies) {