From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 8ADFA1F1C for ; Mon, 29 Oct 2018 12:48:06 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2018 04:48:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,440,1534834800"; d="scan'208";a="99632584" Received: from violet.igk.intel.com ([10.102.54.137]) by fmsmga002.fm.intel.com with ESMTP; 29 Oct 2018 04:48:04 -0700 From: Darek Stojaczyk To: dev@dpdk.org Cc: Darek Stojaczyk , qi.z.zhang@intel.com, anatoly.burakov@intel.com Date: Mon, 29 Oct 2018 12:47:18 +0100 Message-Id: <20181029114718.14143-1-dariusz.stojaczyk@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025104619.137205-1-dariusz.stojaczyk@intel.com> References: <20181025104619.137205-1-dariusz.stojaczyk@intel.com> Subject: [dpdk-dev] [PATCH v2] eal: fix IPC memleak on device hotplug X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 11:48:06 -0000 rte_mp_request_sync() says that the caller is responsible for freeing one of its parameters afterwards. EAL didn't do that, causing a memory leak. Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Cc: qi.z.zhang@intel.com Cc: anatoly.burakov@intel.com Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/hotplug_mp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c index 84f59d95b..b68e4cabb 100644 --- a/lib/librte_eal/common/hotplug_mp.c +++ b/lib/librte_eal/common/hotplug_mp.c @@ -355,6 +355,7 @@ int eal_dev_hotplug_request_to_primary(struct eal_dev_mp_req *req) resp = (struct eal_dev_mp_req *)mp_reply.msgs[0].param; req->result = resp->result; + free(mp_reply.msgs); return ret; } @@ -379,6 +380,7 @@ int eal_dev_hotplug_request_to_secondary(struct eal_dev_mp_req *req) if (mp_reply.nb_sent != mp_reply.nb_received) { RTE_LOG(ERR, EAL, "not all secondary reply\n"); + free(mp_reply.msgs); return -1; } @@ -397,6 +399,7 @@ int eal_dev_hotplug_request_to_secondary(struct eal_dev_mp_req *req) } } + free(mp_reply.msgs); return 0; } -- 2.17.1