From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 0461C1D7; Tue, 13 Nov 2018 13:55:56 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2018 04:55:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,499,1534834800"; d="scan'208";a="85472795" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga007.fm.intel.com with ESMTP; 13 Nov 2018 04:55:54 -0800 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id wADCtsxf022716; Tue, 13 Nov 2018 12:55:54 GMT Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id wADCtUn4022881; Tue, 13 Nov 2018 12:55:30 GMT Received: (from tchaitax@localhost) by wgcvswdev001.ir.intel.com with œ id wADCtUbo022877; Tue, 13 Nov 2018 12:55:30 GMT From: Chaitanya Babu Talluri To: dev@dpdk.org Cc: byron.marohn@intel.com, reshma.pattan@intel.com, pablo.de.lara.guarch@intel.com, Chaitanya Babu Talluri , stable@dpdk.org Date: Tue, 13 Nov 2018 12:55:14 +0000 Message-Id: <1542113714-22607-1-git-send-email-tallurix.chaitanya.babu@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: Subject: [dpdk-stable] [PATCH] lib: fix write unlock during ring creation X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 12:55:57 -0000 In rte_efd_create() write lock has already been unlocked before ring creation itself. So second unlock after the ring creation has been removed and added freeing of tail queue entry and efd table. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: stable@dpdk.org Signed-off-by: Chaitanya Babu Talluri --- lib/librte_efd/rte_efd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index a780e2fe8..0c7ce9612 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -687,12 +687,13 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); snprintf(ring_name, sizeof(ring_name), "HT_%s", table->name); - /* Create ring (Dummy slot index is not enqueued) */ + /* Create ring (Dummy slot index is not enqueued) */ r = rte_ring_create(ring_name, rte_align32pow2(table->max_num_rules), offline_cpu_socket, 0); if (r == NULL) { RTE_LOG(ERR, EFD, "memory allocation failed\n"); - goto error_unlock_exit; + rte_efd_free(table); + return NULL; } /* Populate free slots ring. Entry zero is reserved for key misses. */ -- 2.13.6