From patchwork Thu Apr 25 11:43:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herakliusz Lipiec X-Patchwork-Id: 53069 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C6C51B583; Thu, 25 Apr 2019 13:42:31 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 70A8A1B567 for ; Thu, 25 Apr 2019 13:42:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 04:42:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,393,1549958400"; d="scan'208";a="152266736" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.222.133]) by FMSMGA003.fm.intel.com with ESMTP; 25 Apr 2019 04:42:27 -0700 From: Herakliusz Lipiec To: Cc: dev@dpdk.org, anatoly.burakov@intel.com, Herakliusz Lipiec Date: Thu, 25 Apr 2019 12:43:22 +0100 Message-Id: <20190425114324.611-1-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190423174334.19612-1-herakliusz.lipiec@intel.com> References: <20190423174334.19612-1-herakliusz.lipiec@intel.com> Subject: [dpdk-dev] [PATCH v3 0/2] ipc: fix possible memleaks 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" 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. v2: - resending as patchset to make it easier to review it. - changed commit message as requested. - added bugzilla id. Bugzilla ID: 228 v3: - rework of the patchset - caller is no longer responsible for freeing buffers on failure - caller still has to free response buffers on success Herakliusz Lipiec (2): ipc: fix rte_mp_request_sync memleak ipc: fix tap pmd memleak drivers/net/tap/rte_eth_tap.c | 2 +- lib/librte_eal/common/eal_common_proc.c | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-)