Skip to contentSkip to conversation

mesh: Clear node's agent pointer after agent removal

PATCH In review Inga Stotland 3 participants 3 messages Feb 11, 2021 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesh: Clear node's agent pointer after agent removal

When a node is created/provisioned/imported, the new node's agent is removed. The corresponding pointer in the node structure needs to be set to NULL to avoid pointing to freed memory.

---
 mesh/node.c | 1 +
 1 file changed, 1 insertion(+)
mesh/node.c +1 -0
index 4bc11309b..e81aa82fe 100644
@@ -2321,6 +2321,7 @@ void node_finalize_new_node(struct mesh_node *node, struct mesh_io *io)
 
 	free_node_dbus_resources(node);
 	mesh_agent_remove(node->agent);
+	node->agent = NULL;
 
 	node->busy = false;
 
Signature · 1 line
2.26.2
#1 lore raw

Applied high priority patch.

Quoted 19 lines · Inga Stotland

When a node is created/provisioned/imported, the new node's agent is removed. The corresponding pointer in the node structure needs to be set to NULL to avoid pointing to freed memory.

---
 mesh/node.c | 1 +
 1 file changed, 1 insertion(+)
mesh/node.c +1 -0
index 4bc11309b..e81aa82fe 100644
@@ -2321,6 +2321,7 @@ void node_finalize_new_node(struct mesh_node *node, struct mesh_io *io)
 
 	free_node_dbus_resources(node);
 	mesh_agent_remove(node->agent);
+	node->agent = NULL;
 
 	node->busy = false;
 
#2 lore raw
In reply to Inga Stotland

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=431923

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS

---
Regards,
Linux Bluetooth