Commit a6b35edc authored by Norio Yamaguchi's avatar Norio Yamaguchi Committed by Huiwei Lu
Browse files

Fix memory leak in netmod-IB


Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent ec8ce7a9
......@@ -153,9 +153,7 @@ int MPID_nem_ib_drain_scq(int dont_call_progress)
if (req_type == MPIDI_REQUEST_TYPE_SEND && req->comm) {
/* exclude control messages by requiring MPIDI_REQUEST_TYPE_SEND
* exclude eager-short by requiring req->comm != 0 */
int is_contig;
MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
if (!is_contig && REQ_FIELD(req, lmt_pack_buf)) {
if (REQ_FIELD(req, lmt_pack_buf)) {
dprintf("drain_scq,eager-send,non-contiguous,free lmt_pack_buf=%p\n",
REQ_FIELD(req, lmt_pack_buf));
MPIU_Free(REQ_FIELD(req, lmt_pack_buf));
......
......@@ -111,6 +111,8 @@ static int MPID_nem_ib_iSendContig_core(MPIDI_VC_t * vc, MPID_Request * sreq, vo
MPIDI_CH3U_Request_increment_cc(sreq, &incomplete); // decrement in drain_scq and pkt_rma_lmt_getdone
}
REQ_FIELD(sreq, lmt_pack_buf) = NULL;
/* packet handlers including MPIDI_CH3_PktHandler_EagerSend and MPID_nem_handle_pkt assume this */
hdr_sz = sizeof(MPIDI_CH3_Pkt_t);
......@@ -482,6 +484,9 @@ static int MPID_nem_ib_SendNoncontig_core(MPIDI_VC_t * vc, MPID_Request * sreq,
(char *) REQ_FIELD(sreq, lmt_pack_buf));
MPIU_Assert(last == sreq->dev.segment_size);
}
else {
REQ_FIELD(sreq, lmt_pack_buf) = NULL;
}
data = (void *) REQ_FIELD(sreq, lmt_pack_buf);
data_sz = last;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment