From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH] eal: fix unlock in rte_eal_memzone_init Date: Thu, 6 Dec 2018 09:09:23 +0000 Message-ID: <0bd99be2-07e2-da13-23bb-9774ed470f90@intel.com> References: <1544057251-17351-1-git-send-email-gfree.wind@vip.163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Gao Feng To: gfree.wind@vip.163.com, dev@dpdk.org Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EDCEE6904 for ; Thu, 6 Dec 2018 10:09:26 +0100 (CET) In-Reply-To: <1544057251-17351-1-git-send-email-gfree.wind@vip.163.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 06-Dec-18 12:47 AM, gfree.wind@vip.163.com wrote: > From: Gao Feng > > The RTE_PROC_PRIMARY error handler lost the unlock statement in the > current codes. Now fix it. > > Signed-off-by: Gao Feng Fixes: 49df3db84883 ("memzone: replace memzone array with fbarray") Cc: stable@dpdk.org > --- > lib/librte_eal/common/eal_common_memzone.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c > index b7081af..649cad4 100644 > --- a/lib/librte_eal/common/eal_common_memzone.c > +++ b/lib/librte_eal/common/eal_common_memzone.c > @@ -375,6 +375,7 @@ > rte_fbarray_init(&mcfg->memzones, "memzone", > RTE_MAX_MEMZONE, sizeof(struct rte_memzone))) { > RTE_LOG(ERR, EAL, "Cannot allocate memzone list\n"); > + rte_rwlock_write_unlock(&mcfg->mlock); > return -1; > } else if (rte_eal_process_type() == RTE_PROC_SECONDARY && > rte_fbarray_attach(&mcfg->memzones)) { > Acked-by: Anatoly Burakov Although i would probably remove both unlocks and instead save and return a value, so that unlock happens in one place. But this is OK too. -- Thanks, Anatoly