From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 359D5325F for ; Fri, 3 May 2019 12:28:02 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 03:28:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="321103757" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.222.133]) by orsmga005.jf.intel.com with ESMTP; 03 May 2019 03:28:00 -0700 From: Herakliusz Lipiec To: Cc: dev@dpdk.org, Herakliusz Lipiec Date: Fri, 3 May 2019 11:28:55 +0100 Message-Id: <20190503102857.15812-1-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190425124817.28409-1-herakliusz.lipiec@intel.com> References: <20190425124817.28409-1-herakliusz.lipiec@intel.com> Subject: [dpdk-dev] [PATCH v5 0/2] ipc: fix possible memory leaks 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: Fri, 03 May 2019 10:28:03 -0000 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 initializing message buffer to NULL and calling free everytime rte_mp_request_sync is used. v5: - change prefixes in commit titles. v4: - fixed checkpatch issues v3: - rework of the patchset - caller is no longer responsible for freeing buffers on failure - caller still has to free response buffers on success - patchset reduced from 8 patches to 2 v2: - resending as patchset to make it easier to review it. - changed commit message as requested. - added bugzilla id. Bugzilla ID: 228 Herakliusz Lipiec (2): ipc: fix memory leak in sync request net/tap: fix ipc related memory leak drivers/net/tap/rte_eth_tap.c | 2 +- lib/librte_eal/common/eal_common_proc.c | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) -- 2.17.2 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 207EDA0AC5 for ; Fri, 3 May 2019 12:28:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B13AA326C; Fri, 3 May 2019 12:28:04 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 359D5325F for ; Fri, 3 May 2019 12:28:02 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 03:28:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,425,1549958400"; d="scan'208";a="321103757" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.222.133]) by orsmga005.jf.intel.com with ESMTP; 03 May 2019 03:28:00 -0700 From: Herakliusz Lipiec To: Cc: dev@dpdk.org, Herakliusz Lipiec Date: Fri, 3 May 2019 11:28:55 +0100 Message-Id: <20190503102857.15812-1-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190425124817.28409-1-herakliusz.lipiec@intel.com> References: <20190425124817.28409-1-herakliusz.lipiec@intel.com> Subject: [dpdk-dev] [PATCH v5 0/2] ipc: fix possible memory leaks 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: <20190503102855.9Vv8K62FFVH5ZwxiAiZU1nw2QSJnIqyyGEpFRA2NMU0@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 initializing message buffer to NULL and calling free everytime rte_mp_request_sync is used. v5: - change prefixes in commit titles. v4: - fixed checkpatch issues v3: - rework of the patchset - caller is no longer responsible for freeing buffers on failure - caller still has to free response buffers on success - patchset reduced from 8 patches to 2 v2: - resending as patchset to make it easier to review it. - changed commit message as requested. - added bugzilla id. Bugzilla ID: 228 Herakliusz Lipiec (2): ipc: fix memory leak in sync request net/tap: fix ipc related memory leak drivers/net/tap/rte_eth_tap.c | 2 +- lib/librte_eal/common/eal_common_proc.c | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) -- 2.17.2