diff --git a/ompi/mpi/c/waitall.c b/ompi/mpi/c/waitall.c index 69518963b8..871dbca96a 100644 --- a/ompi/mpi/c/waitall.c +++ b/ompi/mpi/c/waitall.c @@ -37,11 +37,17 @@ int MPI_Waitall(int count, MPI_Request *requests, MPI_Status *statuses) { int rc; if ( MPI_PARAM_CHECK ) { + int i; rc = MPI_SUCCESS; OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (requests == NULL) { rc = MPI_ERR_REQUEST; } + for (i = 0; i < count; i++) { + if (NULL == requests[i]) { + rc = MPI_ERR_REQUEST; + } + } OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); } rc = ompi_request_wait_all(count, requests, statuses); diff --git a/ompi/mpi/c/waitany.c b/ompi/mpi/c/waitany.c index 1de1092925..c221177ef5 100644 --- a/ompi/mpi/c/waitany.c +++ b/ompi/mpi/c/waitany.c @@ -39,11 +39,17 @@ int MPI_Waitany(int count, MPI_Request *requests, int *index, MPI_Status *status { int rc; if ( MPI_PARAM_CHECK ) { + int i; rc = MPI_SUCCESS; OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (requests == NULL) { rc = MPI_ERR_REQUEST; } + for (i = 0; i < count; i++) { + if (NULL == requests[i]) { + rc = MPI_ERR_REQUEST; + } + } OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); } rc = ompi_request_wait_any(count, requests, index, status);