diff mbox series

[BlueZ] mesh: Fix logic error when saving model subscriptions

Message ID 20200811171855.13189-1-inga.stotland@intel.com (mailing list archive)
State Accepted
Headers show
Series [BlueZ] mesh: Fix logic error when saving model subscriptions | expand

Commit Message

Stotland, Inga Aug. 11, 2020, 5:18 p.m. UTC
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(-)

Comments

Brian Gix Aug. 11, 2020, 6:10 p.m. UTC | #1
Applied
On Tue, 2020-08-11 at 10:18 -0700, Inga Stotland wrote:
> 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(-)
> 
> diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c
> index d31c8d99f..9da981700 100644
> --- a/mesh/cfgmod-server.c
> +++ b/mesh/cfgmod-server.c
> @@ -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);
diff mbox series

Patch

diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c
index d31c8d99f..9da981700 100644
--- a/mesh/cfgmod-server.c
+++ b/mesh/cfgmod-server.c
@@ -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);