aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-05-28 19:35:30 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-28 19:36:52 (GMT)
commitf37d8a4da496a9a12fb0ff2b8de6a39130d8fa1f (patch)
treee57cc30b4bec1ba502deeff7fec03a7882c457fc /wpa_supplicant
parent9f83f6a944e4022d82386870558f1bc0ca93d8b3 (diff)
downloadhostap-f37d8a4da496a9a12fb0ff2b8de6a39130d8fa1f.zip
hostap-f37d8a4da496a9a12fb0ff2b8de6a39130d8fa1f.tar.gz
hostap-f37d8a4da496a9a12fb0ff2b8de6a39130d8fa1f.tar.bz2
Indicate scan failure event on parameter cloning failure
This is more consistent with the radio_add_work() error case. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/scan.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 330679c..cb223ab 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -227,10 +227,8 @@ int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
}
ctx = wpa_scan_clone_params(params);
- if (ctx == NULL)
- return -1;
-
- if (radio_add_work(wpa_s, 0, "scan", 0, wpas_trigger_scan_cb, ctx) < 0)
+ if (!ctx ||
+ radio_add_work(wpa_s, 0, "scan", 0, wpas_trigger_scan_cb, ctx) < 0)
{
wpa_scan_free_params(ctx);
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_FAILED "ret=-1");