Skip to content

Commit 2d2d0a7

Browse files
authored
Merge pull request #9973 from jsquyres/pr/ompi-mpi-init-error-paths
ompi_mpi_init: fix some error handling code paths
2 parents 02020f3 + 1ed23c5 commit 2d2d0a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ompi/runtime/ompi_mpi_init.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,13 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided,
370370
goto error;
371371
}
372372

373+
/* Bozo argument check */
374+
if (NULL == argv && argc > 1) {
375+
ret = OMPI_ERR_BAD_PARAM;
376+
error = "argc > 1, but argv == NULL";
377+
goto error;
378+
}
379+
373380
/* if we were not externally started, then we need to setup
374381
* some envars so the MPI_INFO_ENV can get the cmd name
375382
* and argv (but only if the user supplied a non-NULL argv!), and
@@ -395,6 +402,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided,
395402
}
396403
OMPI_TIMING_NEXT("pmix-barrier-1");
397404
if (PMIX_SUCCESS != (rc = PMIx_Fence(NULL, 0, NULL, 0))) {
405+
ret = opal_pmix_convert_status(rc);
398406
error = "timing: pmix-barrier-2 failed";
399407
goto error;
400408
}

0 commit comments

Comments
 (0)