Skip to contentSkip to conversation

mesh: Fix logic error when saving model subscriptions

PATCH Applied Inga Stotland 2 participants 2 messages Aug 11, 2020 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesh: Fix logic error when saving model subscriptions

This fixes opcode check condition when saving configuration for model
subscriptions: use || instead of && for opcode checking

---
 mesh/cfgmod-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mesh/cfgmod-server.c +1 -1
index d31c8d99f..9da981700 100644
@@ -211,7 +211,7 @@ static bool save_cfg_sub(struct mesh_node *node, uint16_t ele_addr,
 	if (virt)
 		memcpy(db_sub.addr.label, label, 16);
 
-	if (opcode == OP_CONFIG_MODEL_SUB_VIRT_DELETE &&
+	if (opcode == OP_CONFIG_MODEL_SUB_VIRT_DELETE ||
 			opcode == OP_CONFIG_MODEL_SUB_DELETE)
 		return mesh_config_model_sub_del(cfg, ele_addr, id, vendor,
 								&db_sub);
Signature · 1 line
2.26.2
Applied
#1 lore raw

Applied

Quoted 19 lines · Inga Stotland

This fixes opcode check condition when saving configuration for model
subscriptions: use || instead of && for opcode checking

---
 mesh/cfgmod-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mesh/cfgmod-server.c +1 -1
index d31c8d99f..9da981700 100644
@@ -211,7 +211,7 @@ static bool save_cfg_sub(struct mesh_node *node, uint16_t ele_addr,
 	if (virt)
 		memcpy(db_sub.addr.label, label, 16);
 
-	if (opcode == OP_CONFIG_MODEL_SUB_VIRT_DELETE &&
+	if (opcode == OP_CONFIG_MODEL_SUB_VIRT_DELETE ||
 			opcode == OP_CONFIG_MODEL_SUB_DELETE)
 		return mesh_config_model_sub_del(cfg, ele_addr, id, vendor,
 								&db_sub);