From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [RFC 4/5] eal/memory: avoid double munmap in error path Date: Tue, 6 Nov 2018 13:49:00 -0800 Message-ID: <20181106214901.1392-5-stephen@networkplumber.org> References: <20181106214901.1392-1-stephen@networkplumber.org> Cc: Stephen Hemminger To: dev@dpdk.org Return-path: Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 9B1A131FC for ; Tue, 6 Nov 2018 22:49:08 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id p6-v6so6829509pll.4 for ; Tue, 06 Nov 2018 13:49:08 -0800 (PST) In-Reply-To: <20181106214901.1392-1-stephen@networkplumber.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Don't call munmap of hugepage memory twice in the error path. Coverity issue: 325730 Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists") Signed-off-by: Stephen Hemminger --- lib/librte_eal/linuxapp/eal/eal_memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index c1b5e079117a..48b23ce19ad3 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -1617,6 +1617,7 @@ eal_legacy_hugepage_init(void) tmp_hp = NULL; munmap(hugepage, nr_hugefiles * sizeof(struct hugepage_file)); + hugepage = NULL; /* we're not going to allocate more pages, so release VA space for * unused memseg lists -- 2.17.1