From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 68441A00E6 for ; Wed, 17 Apr 2019 16:41:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 38F771B6E2; Wed, 17 Apr 2019 16:41:12 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 420091B6B6; Wed, 17 Apr 2019 16:41:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2019 07:41:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,362,1549958400"; d="scan'208";a="316748507" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.222.133]) by orsmga005.jf.intel.com with ESMTP; 17 Apr 2019 07:41:07 -0700 From: Herakliusz Lipiec To: reshma.pattan@intel.com Cc: dev@dpdk.org, Herakliusz Lipiec , jianfeng.tan@intel.com, stable@dpdk.org Date: Wed, 17 Apr 2019 15:41:58 +0100 Message-Id: <20190417144158.23016-1-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.17.2 Subject: [dpdk-dev] [PATCH 5/8] ipc: fix pdump memleak 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190417144158.P18aFbovsxqkzPUdesu3wuloH0ihZJorBNkntfoGdJk@z> When sending multiple requests, rte_mp_request_sync can succeed sending a few of those requests, but then fail on a later one and in the end return with rc=-1. The upper layers - e.g. device hotplug - currently handles this case as if no messages were sent and no memory for response buffers was allocated, which is not true. Fixed by always freeing reply message buffers. Fixes: 660098d61f57 ("pdump: use generic multi-process channel") Cc: jianfeng.tan@intel.com Cc: stable@dpdk.org Signed-off-by: Herakliusz Lipiec --- lib/librte_pdump/rte_pdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 14744b9ff..3787c3e32 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -525,8 +525,8 @@ pdump_prepare_client_request(char *device, uint16_t queue, rte_errno = resp->err_value; if (!resp->err_value) ret = 0; - free(mp_reply.msgs); } + free(mp_reply.msgs); if (ret < 0) RTE_LOG(ERR, PDUMP, -- 2.17.2