From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Yang Subject: [PATCH 2/2] test/memzone: Fix test_memzone_free issue Date: Mon, 15 Jan 2018 13:43:33 +0800 Message-ID: <1515995013-5748-3-git-send-email-phil.yang@arm.com> References: <1515663706-762-1-git-send-email-phil.yang@arm.com> <1515995013-5748-1-git-send-email-phil.yang@arm.com> Cc: anatoly.burakov@intel.com, jianbo.liu@arm.com, herbert.guan@arm.com, phil.yang@arm.com To: dev@dpdk.org 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 44CAAA490 for ; Mon, 15 Jan 2018 06:43:47 +0100 (CET) In-Reply-To: <1515995013-5748-1-git-send-email-phil.yang@arm.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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