From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by dpdk.org (Postfix) with ESMTP id 871FA593E for ; Tue, 19 Aug 2014 05:37:01 +0200 (CEST) Received: from 172.24.2.119 (EHLO szxeml403-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id ATG16694; Tue, 19 Aug 2014 11:40:23 +0800 (CST) Received: from localhost (10.177.25.235) by szxeml403-hub.china.huawei.com (10.82.67.35) with Microsoft SMTP Server id 14.3.158.1; Tue, 19 Aug 2014 11:40:13 +0800 From: To: Date: Tue, 19 Aug 2014 11:39:40 +0800 Message-ID: <1408419580-19684-1-git-send-email-zhang.zhangkun@huawei.com> X-Mailer: git-send-email 1.7.3.1.msysgit.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.25.235] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020208.53F2C728.000E,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 9ff23296dc28b1ea7a20747a0c625125 Cc: zhangkun Subject: [dpdk-dev] [PATCH] there are some memory leak about Dir operator X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2014 03:37:03 -0000 From: zhangkun Signed-off-by: zhangkun --- lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c index b72a205..d784b7c 100644 --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c @@ -311,12 +311,14 @@ eal_hugepage_info_init(void) /* if blocking lock failed */ if (flock(hpi->lock_descriptor, LOCK_EX) == -1) { RTE_LOG(CRIT, EAL, "Failed to lock hugepage directory!\n"); + closedir(dir); return -1; } /* clear out the hugepages dir from unused pages */ - if (clear_hugedir(hpi->hugedir) == -1) + if (clear_hugedir(hpi->hugedir) == -1) { + closedir(dir); return -1; - + } /* for now, put all pages into socket 0, * later they will be sorted */ hpi->num_pages[0] = get_num_hugepages(dirent->d_name); -- 1.7.3.1.msysgit.0