From patchwork Mon Jan 15 05:43:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Yang X-Patchwork-Id: 33713 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 12010A494; Mon, 15 Jan 2018 06:43:49 +0100 (CET) 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) 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 9C2F915A2; Sun, 14 Jan 2018 21:43:46 -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 B7A6E3F41F; Sun, 14 Jan 2018 21:43:45 -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:43:33 +0800 Message-Id: <1515995013-5748-3-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515995013-5748-1-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> Subject: [dpdk-dev] [PATCH 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: , 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];