@@ -158,6 +158,9 @@ int ompi_comm_set_nb ( ompi_communicator_t **ncomm,
158158
159159 /* ompi_comm_allocate */
160160 newcomm = OBJ_NEW (ompi_communicator_t );
161+ if (NULL == newcomm ) {
162+ return OMPI_ERR_OUT_OF_RESOURCE ;
163+ }
161164 newcomm -> super .s_info = NULL ;
162165 /* fill in the inscribing hyper-cube dimensions */
163166 newcomm -> c_cube_dim = opal_cube_dim (local_size );
@@ -354,11 +357,6 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
354357 goto exit ;
355358 }
356359
357- if ( NULL == newcomm ) {
358- rc = MPI_ERR_INTERN ;
359- goto exit ;
360- }
361-
362360 /* Determine context id. It is identical to f_2_c_handle */
363361 rc = ompi_comm_nextcid (newcomp , comm , NULL , NULL , NULL , false, mode );
364362 if ( OMPI_SUCCESS != rc ) {
@@ -580,10 +578,6 @@ int ompi_comm_split( ompi_communicator_t* comm, int color, int key,
580578 local_group , /* local group */
581579 remote_group ); /* remote group */
582580
583- if ( NULL == newcomp ) {
584- rc = MPI_ERR_INTERN ;
585- goto exit ;
586- }
587581 if ( OMPI_SUCCESS != rc ) {
588582 goto exit ;
589583 }
@@ -1004,11 +998,7 @@ int ompi_comm_dup_with_info ( ompi_communicator_t * comm, opal_info_t *info, omp
1004998 true, /* copy the topo */
1005999 comm -> c_local_group , /* local group */
10061000 remote_group ); /* remote group */
1007- if ( NULL == newcomp ) {
1008- rc = MPI_ERR_INTERN ;
1009- return rc ;
1010- }
1011- if ( MPI_SUCCESS != rc ) {
1001+ if ( OMPI_SUCCESS != rc ) {
10121002 return rc ;
10131003 }
10141004
@@ -1103,7 +1093,7 @@ static int ompi_comm_idup_internal (ompi_communicator_t *comm, ompi_group_t *gro
11031093 group , /* local group */
11041094 remote_group , /* remote group */
11051095 subreq ); /* new subrequest */
1106- if (NULL == context -> newcomp ) {
1096+ if (OMPI_SUCCESS != rc ) {
11071097 ompi_comm_request_return (request );
11081098 return rc ;
11091099 }
@@ -1210,11 +1200,7 @@ int ompi_comm_create_group (ompi_communicator_t *comm, ompi_group_t *group, int
12101200 true, /* copy the topo */
12111201 group , /* local group */
12121202 NULL ); /* remote group */
1213- if ( NULL == newcomp ) {
1214- rc = MPI_ERR_INTERN ;
1215- return rc ;
1216- }
1217- if ( MPI_SUCCESS != rc ) {
1203+ if ( OMPI_SUCCESS != rc ) {
12181204 return rc ;
12191205 }
12201206
0 commit comments