Skip to content

coverity: squash some coverity CIDs #13184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions ompi/mpi/c/neighbor_allgatherv.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ PROTOTYPE ERROR_CLASS neighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATAT
BUFFER_OUT recvbuf, COUNT_ARRAY recvcounts, DISP_ARRAY displs,
DATATYPE recvtype, COMM comm)
{
int in_size, out_size, err;
int in_size, out_size, err = MPI_SUCCESS;
ompi_count_array_t recvcounts_desc;
ompi_disp_array_t displs_desc;

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

mca_topo_base_neighbor_count (comm, &in_size, &out_size);
err = mca_topo_base_neighbor_count (comm, &in_size, &out_size);
if (MPI_SUCCESS != err) {
return OMPI_ERRHANDLER_INVOKE(comm, err, FUNC_NAME);
}
ompi_datatype_type_extent(recvtype, &ext);

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

mca_topo_base_neighbor_count (comm, &in_size, &out_size);
err = mca_topo_base_neighbor_count (comm, &in_size, &out_size);
if (MPI_SUCCESS != err) {
return OMPI_ERRHANDLER_INVOKE(comm, err, FUNC_NAME);
}
for (int i = 0; i < in_size; ++i) {
if (recvcounts[i] < 0) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
Expand All @@ -118,7 +124,10 @@ PROTOTYPE ERROR_CLASS neighbor_allgatherv(BUFFER sendbuf, COUNT sendcount, DATAT
}
else if( OMPI_COMM_IS_GRAPH(comm) ) {
int degree;
mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), &degree);
err = mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), &degree);
if (MPI_SUCCESS != err) {
return OMPI_ERRHANDLER_INVOKE(comm, err, FUNC_NAME);
}
if( 0 > degree ) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
}
Expand Down
2 changes: 1 addition & 1 deletion ompi/mpi/c/sendrecv.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PROTOTYPE ERROR_CLASS sendrecv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtyp
DATATYPE recvtype, INT source, INT recvtag,
COMM comm, STATUS_OUT status)
{
ompi_request_t* req;
ompi_request_t* req = MPI_REQUEST_NULL;
int rc = MPI_SUCCESS;
int rcs = MPI_SUCCESS;

Expand Down
5 changes: 3 additions & 2 deletions ompi/mpi/c/unpack.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PROTOTYPE ERROR_CLASS unpack(BUFFER inbuf,
COUNT outcount, DATATYPE datatype,
COMM comm)
{
int rc = MPI_SUCCESS;
int rc = MPI_SUCCESS, rc_keep = MPI_SUCCESS;
opal_convertor_t local_convertor;
struct iovec outvec;
unsigned int iov_count;
Expand Down Expand Up @@ -114,11 +114,12 @@ PROTOTYPE ERROR_CLASS unpack(BUFFER inbuf,
/* All done. Note that the convertor returns 1 upon success, not
OPAL_SUCCESS. */
if (1 != ret) {
rc = OMPI_ERROR;
rc_keep = OMPI_ERROR;
}
}

rc = ompi_datatype_consolidate_free(&dtmod);
rc = (rc_keep != MPI_SUCCESS) ? rc_keep : rc;

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