mesh: Fix clean up after AddNode method
authorInga Stotland <inga.stotland@intel.com>
Sat, 9 Nov 2019 00:07:00 +0000 (16:07 -0800)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 20:49:06 +0000 (02:19 +0530)
This fixes the cleanup routine that is called after AddNode method
on org.bluez.mesh.Manager1 interface is complete: do not remove
the agent associated with the Provisioner (owner of Manager interface).

Change-Id: I8048b820a8e7f29e5e3d9c3001e6d19111af7733
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
mesh/manager.c

index dd4f355..7c1a959 100644 (file)
@@ -82,8 +82,6 @@ static void free_pending_add_call()
                l_dbus_remove_watch(dbus_get_bus(),
                                                add_pending->disc_watch);
 
-       mesh_agent_remove(add_pending->agent);
-
        l_free(add_pending);
        add_pending = NULL;
 }
@@ -248,7 +246,7 @@ static struct l_dbus_message *add_node_call(struct l_dbus *dbus,
        add_pending = l_new(struct add_data, 1);
        memcpy(add_pending->uuid, uuid, 16);
        add_pending->node = node;
-       add_pending->agent = node_get_agent(node);;
+       add_pending->agent = node_get_agent(node);
 
        if (!node_is_provisioner(node) || (add_pending->agent == NULL)) {
                l_info("Provisioner: %d", node_is_provisioner(node));