From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jianbo Liu Subject: Re: [PATCH] test/memzone: Fix test_memzone_basic & test_memzone_free issues. Date: Fri, 12 Jan 2018 13:46:58 +0800 Message-ID: <20180112054657.GA4214@arm.com> References: <1515663706-762-1-git-send-email-phil.yang@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, nd@arm.com, herbert.guan@arm.com To: Phil Yang Return-path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10041.outbound.protection.outlook.com [40.107.1.41]) by dpdk.org (Postfix) with ESMTP id 917F42951 for ; Fri, 12 Jan 2018 06:48:24 +0100 (CET) Content-Disposition: inline In-Reply-To: <1515663706-762-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" The 01/11/2018 17:41, Phil Yang wrote: > 1. test_memzone_basic: No need to free a NULL memzone. It will cause test > termination. > 2. test_memzone_free: Out of mz[RTE_MAX_MEMZONE] memory bound while > reserving memzone for mz. It will flush variable i. Fix by extend to > mz[RTE_MAX_MEMZONE + 1]. > > Signed-off-by: Phil Yang Acked-by: Jianbo Liu > --- > test/test/test_memzone.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c > index 6e80977..24e29a7 100644 > --- a/test/test/test_memzone.c > +++ b/test/test/test_memzone.c > @@ -251,10 +251,6 @@ test_memzone_reserve_flags(void) > printf("MEMZONE FLAG 2MB\n"); > return -1; > } > - if (rte_memzone_free(mz)) { > - printf("Fail memzone free\n"); > - return -1; > - } > } > > if (hugepage_2MB_avail && hugepage_1GB_avail) { > @@ -746,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 > -- IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.