wsc: Make sure the initial scan can be started

In push button mode, ensure the initial scan was actually queued
successfully.
This commit is contained in:
Denis Kenzior 2017-02-03 17:58:31 -06:00
parent 4e9dc77b2d
commit 58ec4ec1c1
1 changed files with 7 additions and 0 deletions

View File

@ -678,6 +678,13 @@ static bool wsc_start_pushbutton(struct wsc *wsc)
wsc->scan_id = scan_active(device_get_ifindex(wsc->device),
wsc->wsc_ies, wsc->wsc_ies_size,
NULL, scan_results, wsc, NULL);
if (!wsc->scan_id) {
l_free(wsc->wsc_ies);
wsc->wsc_ies = NULL;
return false;
}
wsc->walk_timer = l_timeout_create(WALK_TIME, walk_timeout, wsc, NULL);
return true;