From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 396D61B127; Tue, 23 Apr 2019 19:43:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 10:43:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,386,1549958400"; d="scan'208";a="226004735" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.222.133]) by orsmga001.jf.intel.com with ESMTP; 23 Apr 2019 10:43:25 -0700 From: Herakliusz Lipiec To: Cc: dev@dpdk.org, Herakliusz Lipiec , jianfeng.tan@intel.com, stable@dpdk.org Date: Tue, 23 Apr 2019 18:43:29 +0100 Message-Id: <20190423174334.19612-4-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190423174334.19612-1-herakliusz.lipiec@intel.com> References: <20190417143822.21276-1-herakliusz.lipiec@intel.com> <20190423174334.19612-1-herakliusz.lipiec@intel.com> Subject: [dpdk-dev] [PATCH v2 3/8] ipc: fix vdev 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: , X-List-Received-Date: Tue, 23 Apr 2019 17:43:27 -0000 When sending synchronous IPC requests, the caller must free the response buffer even if the request returned failure. Fix the code to correctly use the IPC API. Bugzilla ID: 228 Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: jianfeng.tan@intel.com Cc: stable@dpdk.org Signed-off-by: Herakliusz Lipiec --- drivers/bus/vdev/vdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 04f76a63f..7c43f2ddd 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -429,10 +429,9 @@ vdev_scan(void) mp_rep = &mp_reply.msgs[0]; resp = (struct vdev_param *)mp_rep->param; VDEV_LOG(INFO, "Received %d vdevs", resp->num); - free(mp_reply.msgs); } else VDEV_LOG(ERR, "Failed to request vdev from primary"); - + free(mp_reply.msgs); /* Fall through to allow private vdevs in secondary process */ } -- 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 CDEC0A05D3 for ; Tue, 23 Apr 2019 19:43:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 479A91B4D9; Tue, 23 Apr 2019 19:43:34 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 396D61B127; Tue, 23 Apr 2019 19:43:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 10:43:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,386,1549958400"; d="scan'208";a="226004735" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.222.133]) by orsmga001.jf.intel.com with ESMTP; 23 Apr 2019 10:43:25 -0700 From: Herakliusz Lipiec To: Cc: dev@dpdk.org, Herakliusz Lipiec , jianfeng.tan@intel.com, stable@dpdk.org Date: Tue, 23 Apr 2019 18:43:29 +0100 Message-Id: <20190423174334.19612-4-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190423174334.19612-1-herakliusz.lipiec@intel.com> References: <20190417143822.21276-1-herakliusz.lipiec@intel.com> <20190423174334.19612-1-herakliusz.lipiec@intel.com> Subject: [dpdk-dev] [PATCH v2 3/8] ipc: fix vdev 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: <20190423174329.ZKfXvNdsAgjLuFspOd5ezz2uEmNTDaC1n881pmRUITo@z> When sending synchronous IPC requests, the caller must free the response buffer even if the request returned failure. Fix the code to correctly use the IPC API. Bugzilla ID: 228 Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: jianfeng.tan@intel.com Cc: stable@dpdk.org Signed-off-by: Herakliusz Lipiec --- drivers/bus/vdev/vdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 04f76a63f..7c43f2ddd 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -429,10 +429,9 @@ vdev_scan(void) mp_rep = &mp_reply.msgs[0]; resp = (struct vdev_param *)mp_rep->param; VDEV_LOG(INFO, "Received %d vdevs", resp->num); - free(mp_reply.msgs); } else VDEV_LOG(ERR, "Failed to request vdev from primary"); - + free(mp_reply.msgs); /* Fall through to allow private vdevs in secondary process */ } -- 2.17.2