ompi/comm: fix coverity errors
Fixes CID 1323841: Logically dead code Wrong value in conditional. Should be newcomp not newcomm. Fixes CID 1269762: Explicit null dereference ompi_group_incl could return an error and not set local_group. Add a check to ensure ompi_group_incl succeeded before incrementing the proc count. Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
родитель
6611c000c9
Коммит
6b83fa2f58
@ -565,7 +565,11 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
|
||||
}
|
||||
}
|
||||
|
||||
ompi_group_incl(comm->c_local_group, my_size, lranks, &local_group);
|
||||
rc = ompi_group_incl(comm->c_local_group, my_size, lranks, &local_group);
|
||||
if (OMPI_SUCCESS != rc) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ompi_group_increment_proc_count(local_group);
|
||||
|
||||
mode = OMPI_COMM_CID_INTER;
|
||||
@ -588,8 +592,7 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
|
||||
comm->error_handler,/* error handler */
|
||||
pass_on_topo,
|
||||
local_group, /* local group */
|
||||
remote_group /* remote group */
|
||||
);
|
||||
remote_group); /* remote group */
|
||||
|
||||
if ( NULL == newcomp ) {
|
||||
rc = MPI_ERR_INTERN;
|
||||
@ -918,7 +921,7 @@ ompi_comm_split_type(ompi_communicator_t *comm,
|
||||
NULL, /* local group */
|
||||
NULL ); /* remote group */
|
||||
|
||||
if ( NULL == newcomm ) {
|
||||
if ( NULL == newcomp ) {
|
||||
rc = MPI_ERR_INTERN;
|
||||
goto exit;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user