[PATCH BlueZ] mesh: Fix the cleanup of failed Join call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes the accidental swap of conditional checks: on failure,
remove agent info if agent is registered and remove temporary node,
if one has been created.
---
 mesh/node.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesh/node.c b/mesh/node.c
index dae9a4b79..5431a9e9c 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -1474,10 +1474,10 @@ static void get_managed_objects_join_cb(struct l_dbus_message *msg,
 	return;
 fail:
 	if (agent)
-		free_node_resources(node);
+		mesh_agent_remove(agent);
 
 	if (node)
-		mesh_agent_remove(agent);
+		free_node_resources(node);
 
 	req->cb(NULL, NULL);
 }
-- 
2.17.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux