mesh: Fix logic error when saving model subscriptions
authorInga Stotland <inga.stotland@intel.com>
Tue, 11 Aug 2020 17:18:55 +0000 (10:18 -0700)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
This fixes opcode check condition when saving configuration for model
subscriptions: use || instead of && for opcode checking

Change-Id: I5d80c0dad98458ceca565b40c824081e6916f02f
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
mesh/cfgmod-server.c

index 6139979..52a0e02 100644 (file)
@@ -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);