Skip to content

Commit a78cc2c

Browse files
authored
Merge pull request #11686 from lrbison/coverity
mtl/ofi: Remove unused variables, and check ompi_ret
2 parents 6256b00 + 7eab3f6 commit a78cc2c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

ompi/mca/mtl/ofi/mtl_ofi.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,12 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
224224
int ret = OMPI_SUCCESS;
225225
size_t i;
226226
size_t size;
227-
size_t namelen;
228227
int count = 0;
229228
char *ep_name = NULL;
230229
fi_addr_t *fi_addrs = NULL;
231230
mca_mtl_ofi_endpoint_t *endpoint = NULL;
232231
int num_peers_limit = (1 << ompi_mtl_ofi.num_bits_source_rank) - 1;
233232

234-
namelen = ompi_mtl_ofi.epnamelen;
235-
236233
/* We cannot add more ranks than available tag bits */
237234
if ((false == ompi_mtl_ofi.fi_cq_data) &&
238235
OPAL_UNLIKELY(((int) (nprocs + ompi_mtl_ofi.num_peers) > num_peers_limit))) {

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,11 +865,17 @@ ompi_mtl_ofi_send_generic(struct mca_mtl_base_module_t *mtl,
865865
if (mtl_comm->c_index_vec[dest].c_index_state == MCA_MTL_OFI_CID_NOT_EXCHANGED) {
866866
mtl_comm->c_index_vec[dest].c_index_state = MCA_MTL_OFI_CID_EXCHANGING;
867867
ompi_ret = ompi_mtl_ofi_send_excid(mtl, comm, dest, ofi_cq_data, true);
868+
if (OPAL_UNLIKELY(OMPI_SUCCESS != ompi_ret)) {
869+
return ompi_ret;
870+
}
868871
}
869872

870873
if (mtl_comm->c_index_vec[dest].c_index_state > MCA_MTL_OFI_CID_EXCHANGED) {
871874
while (mtl_comm->c_index_vec[dest].c_index_state > MCA_MTL_OFI_CID_EXCHANGED) {
872875
ompi_ret = ompi_mtl_ofi_post_recv_excid_buffer(true, comm, dest);
876+
if (OPAL_UNLIKELY(OMPI_SUCCESS != ompi_ret)) {
877+
return ompi_ret;
878+
}
873879
}
874880
}
875881
c_index_for_tag = mtl_comm->c_index_vec[dest].c_index;

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
576576
struct fi_info *hints, *hints_dup = NULL;
577577
struct fi_info *providers = NULL;
578578
struct fi_info *prov = NULL;
579-
struct fi_info *prov_cq_data = NULL;
580579
void *ep_name = NULL;
581580
size_t namelen = 0;
582581
int universe_size;
@@ -1137,9 +1136,6 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
11371136
if (providers) {
11381137
(void) fi_freeinfo(providers);
11391138
}
1140-
if (prov_cq_data) {
1141-
(void) fi_freeinfo(prov_cq_data);
1142-
}
11431139
if (hints) {
11441140
(void) fi_freeinfo(hints);
11451141
}

0 commit comments

Comments
 (0)