[PATCH] P2P: Only call dev_lost() for devices that have been dev_found()

Angie Chinchilla angie.v.chinchilla
Fri Jul 1 11:19:51 PDT 2011


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 at intel.com>
---
 src/p2p/p2p.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 181cc85..95c4b35 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -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]);
-- 
1.7.0.4




More information about the Hostap mailing list