From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 54BDA2BE5 for ; Mon, 15 Jan 2018 06:52:41 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BD89015A2; Sun, 14 Jan 2018 21:52:40 -0800 (PST) Received: from phil-VirtualBox.shanghai.arm.com (phil-virtualbox.shanghai.arm.com [10.169.38.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DA4753F41F; Sun, 14 Jan 2018 21:52:39 -0800 (PST) From: Phil Yang To: dev@dpdk.org Cc: anatoly.burakov@intel.com, jianbo.liu@arm.com, herbert.guan@arm.com, phil.yang@arm.com Date: Mon, 15 Jan 2018 13:52:26 +0800 Message-Id: <1515995546-5981-3-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515995546-5981-1-git-send-email-phil.yang@arm.com> References: <1515663706-762-1-git-send-email-phil.yang@arm.com> <1515995546-5981-1-git-send-email-phil.yang@arm.com> Subject: [dpdk-dev] [PATCH v2 2/2] test/memzone: Fix test_memzone_free issue 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: Mon, 15 Jan 2018 05:52:41 -0000 When reserving memzone for mz[], it will out of mz[RTE_MAX_MEMZONE] memory bound after the counter reached to RTE_MAX_MEMZONE. It will flush the counter's memory and lead to mz[] memory cannot be freed. Fixd by extend to mz[RTE_MAX_MEMZONE + 1]. Signed-off-by: Phil Yang --- test/test/test_memzone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c index 9c20172..24e29a7 100644 --- a/test/test/test_memzone.c +++ b/test/test/test_memzone.c @@ -742,7 +742,7 @@ test_memzone_bounded(void) static int test_memzone_free(void) { - const struct rte_memzone *mz[RTE_MAX_MEMZONE]; + const struct rte_memzone *mz[RTE_MAX_MEMZONE + 1]; int i; char name[20]; -- 2.7.4