linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] mesh: Fix the cleanup of failed Join call
@ 2019-04-18  4:33 Inga Stotland
  0 siblings, 0 replies; only message in thread
From: Inga Stotland @ 2019-04-18  4:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: brian.gix, johan.hedberg, luiz.dentz, Inga Stotland

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-18  4:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-18  4:33 [PATCH BlueZ] mesh: Fix the cleanup of failed Join call Inga Stotland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).