From 9a4c67c47896fb9aa0fd8935813f2016b543a9df Mon Sep 17 00:00:00 2001
From: Changsheng Wu <wuchangsheng2@huawei.com>
Date: Sat, 18 Dec 2021 16:45:51 +0800
Subject: [PATCH] 
 huawei-0008-dpdk-fix-error-in-clearing-secondary-process-memseg-lists

---
 lib/eal/common/eal_common_fbarray.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 9c125c104c..d4a4cea7c1 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -1102,7 +1102,7 @@ int
 rte_sec_fbarray_destroy(struct rte_fbarray *arr,
 		const int sec_idx)
 {
-	int fd, ret;
+	int fd;
 	char path[PATH_MAX];
 
 	if (arr == NULL) {
@@ -1128,15 +1128,13 @@ rte_sec_fbarray_destroy(struct rte_fbarray *arr,
 	if (flock(fd, LOCK_EX | LOCK_NB)) {
 		RTE_LOG(DEBUG, EAL, "Cannot destroy fbarray - another process is using it\n");
 		rte_errno = EBUSY;
-		ret = -1;
 	} else {
-		ret = 0;
 		unlink(path);
 		memset(arr, 0, sizeof(*arr));
 	}
 	close(fd);
 	
-	return ret;
+	return 0;
 }
 
 void *
-- 
2.27.0

