Skip to contentSkip to conversation

mesh: Zero out config node struct before initializing

PATCH Applied Inga Stotland 3 participants 3 messages Dec 2, 2020 – Dec 4, 2020 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesh: Zero out config node struct before initializing

This memsets all the fields of mesh_db_node to zero prior to intializing some fields in mesh_config_node struct and creating a brand new node configuration. Just a precaution against having uninitialized items.

---
 mesh/node.c | 2 ++
 1 file changed, 2 insertions(+)
mesh/node.c +2 -0
index 35293e0f0..4bc11309b 100644
@@ -856,6 +856,8 @@ static void convert_node_to_storage(struct mesh_node *node,
 {
 	const struct l_queue_entry *entry;
 
+	memset(db_node, 0, sizeof(struct mesh_config_node));
+
 	db_node->cid = node->comp.cid;
 	db_node->pid = node->comp.pid;
 	db_node->vid = node->comp.vid;
Signature · 1 line
2.26.2
#1 lore raw

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=394959

---Test result---

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

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

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

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

---
Regards,
Linux Bluetooth

Applied
#2 lore raw
In reply to Inga Stotland

Applied

Quoted 20 lines · Inga Stotland

This memsets all the fields of mesh_db_node to zero prior to intializing some fields in mesh_config_node struct and creating a brand new node configuration. Just a precaution against having uninitialized items.

---
 mesh/node.c | 2 ++
 1 file changed, 2 insertions(+)
mesh/node.c +2 -0
index 35293e0f0..4bc11309b 100644
@@ -856,6 +856,8 @@ static void convert_node_to_storage(struct mesh_node *node,
 {
 	const struct l_queue_entry *entry;
 
+	memset(db_node, 0, sizeof(struct mesh_config_node));
+
 	db_node->cid = node->comp.cid;
 	db_node->pid = node->comp.pid;
 	db_node->vid = node->comp.vid;