From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9AA5BA046B for ; Sun, 18 Aug 2019 08:47:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A25861B96B; Sun, 18 Aug 2019 08:47:42 +0200 (CEST) Received: from mta.qwilt.com (mta.qwilt.com [52.9.191.255]) by dpdk.org (Postfix) with ESMTP id 8303537B7 for ; Sun, 18 Aug 2019 08:47:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mta.qwilt.com (Postfix) with ESMTP id BFE759697AF; Sun, 18 Aug 2019 06:47:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at qwilt.com Received: from mta.qwilt.com ([127.0.0.1]) by localhost (mta.qwilt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VrBB4flgZaVu; Sun, 18 Aug 2019 06:47:40 +0000 (UTC) Received: from rd02.it.qwilt.com.qwilt.com (backup [80.179.204.39]) by mta.qwilt.com (Postfix) with ESMTPSA id 6A443880206; Sun, 18 Aug 2019 06:47:39 +0000 (UTC) From: Arnon Warshavsky To: dev@dpdk.org Cc: arnonw@qwilt.com, john.mcnamara@intel.com, Arnon Warshavsky Date: Sun, 18 Aug 2019 09:47:34 +0300 Message-Id: <1566110854-2669-1-git-send-email-arnon@qwilt.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] eal: unmap undesired address upon config reattach failure 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" Have rte_eal_config_reattach clean up the mapped address which is a valid address but not the one intended. Coverity issue: 343439 Signed-off-by: Arnon Warshavsky --- lib/librte_eal/linux/eal/eal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index 946222c..fac69b9 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -438,6 +438,7 @@ enum rte_iova_mode RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]" " - please use '--base-virtaddr' option\n", rte_mem_cfg_addr, mem_config); + munmap(mem_config, sizeof(struct rte_mem_config)); return -1; } RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n", -- 1.8.3.1