Thread (3 messages) flat view 3 messages, 3 authors, 2021-02-11
STALE2051d

[PATCH BlueZ] mesh: Clear node's agent pointer after agent removal

From: Inga Stotland <hidden>
Date: 2021-02-11 02:56:59
Subsystem: the rest · Maintainer: Linus Torvalds

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(+)
diff --git a/mesh/node.c b/mesh/node.c
index 4bc11309b..e81aa82fe 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -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.26.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help