]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Only call dev_lost() for devices that have been dev_found()
authorAngie Chinchilla <angie.v.chinchilla@intel.com>
Mon, 4 Jul 2011 17:30:16 +0000 (20:30 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 4 Jul 2011 17:30:16 +0000 (20:30 +0300)
Fix a bug with the current dev_found()/dev_lost() usage. Previously
in p2p_device_free() dev_lost() was invoked for devices that had
not been dev_found(). This caused dbus related msgs to stderr like:
"Attempted to unregister path (path[0] = fi path[1] = w1) which isn't
registered"

Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
src/p2p/p2p.c

index 191099a5c5cf4194eecbffc6a853c5fcf075351b..d4fac5614688279d94ec75f33567b6c056e1ec04 100644 (file)
@@ -634,7 +634,10 @@ static void p2p_device_free(struct p2p_data *p2p, struct p2p_device *dev)
        if (p2p->pending_client_disc_go == dev)
                p2p->pending_client_disc_go = NULL;
 
-       p2p->cfg->dev_lost(p2p->cfg->cb_ctx, dev->info.p2p_device_addr);
+       /* dev_lost() device, but only if it was previously dev_found() */
+       if (dev->flags & P2P_DEV_REPORTED_ONCE)
+               p2p->cfg->dev_lost(p2p->cfg->cb_ctx,
+                                  dev->info.p2p_device_addr);
 
        for (i = 0; i < P2P_MAX_WPS_VENDOR_EXT; i++) {
                wpabuf_free(dev->info.wps_vendor_ext[i]);