Skip to content

Commit 171994f

Browse files
authored
Merge pull request #13184 from hppritcha/some_coverity_stuff
coverity: squash some coverity CIDs
2 parents 43e4e55 + ae7f04f commit 171994f

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

ompi/mpi/c/neighbor_allgatherv.c.in

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PROTOTYPE ERROR_CLASS neighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATAT
4444
BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs,
4545
DATATYPE recvtype, COMM comm)
4646
{
47-
int in_size, out_size, err;
47+
int in_size, out_size, err = MPI_SUCCESS;
4848
ompi_count_array_t recvcounts_desc;
4949
ompi_disp_array_t displs_desc;
5050

@@ -53,7 +53,10 @@ PROTOTYPE ERROR_CLASS neighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATAT
5353
MEMCHECKER(
5454
ptrdiff_t ext;
5555

56-
mca_topo_base_neighbor_count (comm, &in_size, &out_size);
56+
err = mca_topo_base_neighbor_count (comm, &in_size, &out_size);
57+
if (MPI_SUCCESS != err) {
58+
return OMPI_ERRHANDLER_INVOKE(comm, err, FUNC_NAME);
59+
}
5760
ompi_datatype_type_extent(recvtype, &ext);
5861

5962
memchecker_datatype(recvtype);
@@ -99,7 +102,10 @@ PROTOTYPE ERROR_CLASS neighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATAT
99102
get the size of the remote group here for both intra- and
100103
intercommunicators */
101104

102-
mca_topo_base_neighbor_count (comm, &in_size, &out_size);
105+
err = mca_topo_base_neighbor_count (comm, &in_size, &out_size);
106+
if (MPI_SUCCESS != err) {
107+
return OMPI_ERRHANDLER_INVOKE(comm, err, FUNC_NAME);
108+
}
103109
for (int i = 0; i < in_size; ++i) {
104110
if (recvcounts[i] < 0) {
105111
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
@@ -118,7 +124,10 @@ PROTOTYPE ERROR_CLASS neighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATAT
118124
}
119125
else if( OMPI_COMM_IS_GRAPH(comm) ) {
120126
int degree;
121-
mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), &degree);
127+
err = mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), &degree);
128+
if (MPI_SUCCESS != err) {
129+
return OMPI_ERRHANDLER_INVOKE(comm, err, FUNC_NAME);
130+
}
122131
if( 0 > degree ) {
123132
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
124133
}

ompi/mpi/c/sendrecv.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PROTOTYPE ERROR_CLASS sendrecv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtyp
4141
DATATYPE recvtype, INT source, INT recvtag,
4242
COMM comm, STATUS_OUT status)
4343
{
44-
ompi_request_t* req;
44+
ompi_request_t* req = MPI_REQUEST_NULL;
4545
int rc = MPI_SUCCESS;
4646
int rcs = MPI_SUCCESS;
4747

ompi/mpi/c/unpack.c.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PROTOTYPE ERROR_CLASS unpack(BUFFER inbuf,
3939
COUNT outcount, DATATYPE datatype,
4040
COMM comm)
4141
{
42-
int rc = MPI_SUCCESS;
42+
int rc = MPI_SUCCESS, rc_keep = MPI_SUCCESS;
4343
opal_convertor_t local_convertor;
4444
struct iovec outvec;
4545
unsigned int iov_count;
@@ -114,11 +114,12 @@ PROTOTYPE ERROR_CLASS unpack(BUFFER inbuf,
114114
/* All done. Note that the convertor returns 1 upon success, not
115115
OPAL_SUCCESS. */
116116
if (1 != ret) {
117-
rc = OMPI_ERROR;
117+
rc_keep = OMPI_ERROR;
118118
}
119119
}
120120

121121
rc = ompi_datatype_consolidate_free(&dtmod);
122+
rc = (rc_keep != MPI_SUCCESS) ? rc_keep : rc;
122123

123124
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
124125
}

0 commit comments

Comments
 (0)