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 07F074C95; Thu, 25 Oct 2018 12:48:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 03:48:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,424,1534834800"; d="scan'208";a="94908948" Received: from violet.igk.intel.com ([10.102.54.177]) by orsmga003.jf.intel.com with ESMTP; 25 Oct 2018 03:48:37 -0700 From: Darek Stojaczyk To: dev@dpdk.org Cc: anatoly.burakov@intel.com, Darek Stojaczyk , jianfeng.tan@intel.com, qi.z.zhang@intel.com, stable@dpdk.org, Paul Luse Date: Thu, 25 Oct 2018 12:47:35 +0200 Message-Id: <20181025104735.137381-1-dariusz.stojaczyk@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] vdev: fix rte_mp_request_sync() memleak on scan 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: Thu, 25 Oct 2018 10:48:41 -0000 rte_mp_request_sync() says that the caller is responsible for freeing one of its parameters afterwards. vdev didn't do that, causing a memory leak. Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: jianfeng.tan@intel.com Cc: qi.z.zhang@intel.com Cc: stable@dpdk.org Signed-off-by: Paul Luse Signed-off-by: Darek Stojaczyk --- drivers/bus/vdev/vdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 688e31c21..685cc4e78 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -425,6 +425,7 @@ 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"); -- 2.17.1