P2P: Fix p2p_scan() error processing in p2p_search()
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 9 Feb 2012 10:46:44 +0000 (12:46 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 9 Feb 2012 10:46:44 +0000 (12:46 +0200)
Commit 39185dfa549f076a6be114e0149a3649d302f477 changed the p2p_scan()
callback to return 1 in some cases, but forgot to change this p2p_scan()
call to handle that properly. Fix this by processing any non-zero value
as an error. This regression could leave the P2P module in state where
it believed a P2P scan was still running and refused to start some
operations until that scan gets completed (which would never happen
since it was not really started).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/p2p/p2p.c

index e7ce230..82932aa 100644 (file)
@@ -824,7 +824,7 @@ static void p2p_search(struct p2p_data *p2p)
 
        if (p2p->cfg->p2p_scan(p2p->cfg->cb_ctx, type, freq,
                               p2p->num_req_dev_types, p2p->req_dev_types,
-                              p2p->find_dev_id) < 0) {
+                              p2p->find_dev_id)) {
                wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
                        "P2P: Scan request failed");
                p2p_continue_find(p2p);