linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] mesh: Clear node's agent pointer after agent removal
@ 2021-02-11  2:55 Inga Stotland
  2021-02-11  3:04 ` Gix, Brian
  2021-02-11  3:35 ` [BlueZ] " bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Inga Stotland @ 2021-02-11  2:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: brian.gix, 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(+)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ] mesh: Clear node's agent pointer after agent removal
  2021-02-11  2:55 [PATCH BlueZ] mesh: Clear node's agent pointer after agent removal Inga Stotland
@ 2021-02-11  3:04 ` Gix, Brian
  2021-02-11  3:35 ` [BlueZ] " bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: Gix, Brian @ 2021-02-11  3:04 UTC (permalink / raw)
  To: linux-bluetooth, Stotland, Inga

Applied high priority patch.

On Wed, 2021-02-10 at 18:55 -0800, Inga Stotland wrote:
> 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;
>  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [BlueZ] mesh: Clear node's agent pointer after agent removal
  2021-02-11  2:55 [PATCH BlueZ] mesh: Clear node's agent pointer after agent removal Inga Stotland
  2021-02-11  3:04 ` Gix, Brian
@ 2021-02-11  3:35 ` bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2021-02-11  3:35 UTC (permalink / raw)
  To: linux-bluetooth, inga.stotland

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-11  3:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11  2:55 [PATCH BlueZ] mesh: Clear node's agent pointer after agent removal Inga Stotland
2021-02-11  3:04 ` Gix, Brian
2021-02-11  3:35 ` [BlueZ] " bluez.test.bot

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).