diff --git a/ompi/mca/pml/ob1/pml_ob1_isend.c b/ompi/mca/pml/ob1/pml_ob1_isend.c index 052b44fe7e..d49666cbc6 100644 --- a/ompi/mca/pml/ob1/pml_ob1_isend.c +++ b/ompi/mca/pml/ob1/pml_ob1_isend.c @@ -234,14 +234,12 @@ int mca_pml_ob1_send(void *buf, PERUSE_SEND); MCA_PML_OB1_SEND_REQUEST_START_W_SEQ(sendreq, endpoint, seqn, rc); - if (rc != OMPI_SUCCESS) { - return rc; - } - - ompi_request_wait_completion(&sendreq->req_send.req_base.req_ompi); + if (OPAL_LIKELY(rc == OMPI_SUCCESS)) { + ompi_request_wait_completion(&sendreq->req_send.req_base.req_ompi); - rc = sendreq->req_send.req_base.req_ompi.req_status.MPI_ERROR; - MCA_PML_BASE_SEND_REQUEST_FINI(&sendreq->req_send); + rc = sendreq->req_send.req_base.req_ompi.req_status.MPI_ERROR; + MCA_PML_BASE_SEND_REQUEST_FINI(&sendreq->req_send); + } OBJ_DESTRUCT(sendreq); return rc;