From 924d39e415e7df53841803941e450aa42b119650 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Thu, 30 Oct 2014 01:28:50 -0400 Subject: [PATCH] Always OBJ_DESTRUCT the send request. --- ompi/mca/pml/ob1/pml_ob1_isend.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1_isend.c b/ompi/mca/pml/ob1/pml_ob1_isend.c index 1ebdfde839d..80bb8e350c7 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_UNLIKELY(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;