mesh: Clear nodes queue on get_managed_objects_cb() fails
authorJakub Witowski <jakub.witowski@silvair.com>
Fri, 28 Jun 2019 09:50:49 +0000 (11:50 +0200)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 15:20:12 +0000 (20:50 +0530)
Currently when the get_managed_objects_cb() fails it frees
the node resources but the node still remains on the "nodes" queue.

This implementation calls node_remove() instead of
free_node_resources()."

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

index f8bb8d4..b1f1c73 100644 (file)
@@ -1603,7 +1603,7 @@ fail:
        } else {
                /* Handle failed Join and Create requests */
                if (node)
-                       free_node_resources(node);
+                       node_remove(node);
 
                if (req->type == REQUEST_TYPE_JOIN) {
                        node_join_ready_func_t cb = req->cb;