diff --git a/src/cm_mes/mes_func.c b/src/cm_mes/mes_func.c index 5a2fe9b2d33ba93630971b89bb9de0cf6b2f5945..c6a7551acf5f7a7a550a312ebb1142dc30180b08 100644 --- a/src/cm_mes/mes_func.c +++ b/src/cm_mes/mes_func.c @@ -1615,10 +1615,12 @@ int mes_connect(inst_type inst_id) } for (uint32 i = 0; i < MES_GLOBAL_INST_MSG.profile.inst_cnt; i++) { - if (inst_id == MES_GLOBAL_INST_MSG.profile.inst_net_addr[i].inst_id && - !MES_GLOBAL_INST_MSG.profile.inst_net_addr[i].need_connect) { - LOG_RUN_WAR("[mes] do not need create connection, inst_id %u", inst_id); - return CM_SUCCESS; + if (inst_id == MES_GLOBAL_INST_MSG.profile.inst_net_addr[i].inst_id) { + if(!MES_GLOBAL_INST_MSG.profile.inst_net_addr[i].need_connect) { + LOG_RUN_WAR("[mes] do not need create connection, inst_id %u", inst_id); + return CM_SUCCESS; + } + break; } }