aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-05-28 19:16:47 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-28 19:47:31 (GMT)
commit8e909fa92e59c9a4bc0472603decb8a334f7808a (patch)
tree7ca8b0581602bf92741706bb6fed44bcda25311e /wpa_supplicant/scan.c
parentfccc4bd518a51b5112f71ad992eb21e9a359067d (diff)
downloadhostap-8e909fa92e59c9a4bc0472603decb8a334f7808a.zip
hostap-8e909fa92e59c9a4bc0472603decb8a334f7808a.tar.gz
hostap-8e909fa92e59c9a4bc0472603decb8a334f7808a.tar.bz2
Improve reattach scan OOM failure handling
Instead of reporting the memory allocation failure and stopping, run the scan even if the frequency list cannot be created due to allocation failure. This allows the wpa_s->reattach flag to be cleared and the scan to be completed even if it takes a bit longer time due to all channels getting scanned. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/scan.c')
-rw-r--r--wpa_supplicant/scan.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index cb223ab..40469ca 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -835,12 +835,10 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
* slot for the zero-terminator.
*/
params.freqs = os_malloc(sizeof(int) * 2);
- if (params.freqs == NULL) {
- wpa_dbg(wpa_s, MSG_ERROR, "Memory allocation failed");
- return;
+ if (params.freqs) {
+ params.freqs[0] = wpa_s->assoc_freq;
+ params.freqs[1] = 0;
}
- params.freqs[0] = wpa_s->assoc_freq;
- params.freqs[1] = 0;
/*
* Reset the reattach flag so that we fall back to full scan if