Skip to contentSkip to conversation

fbarray: fix metadata dump

PATCH Applied David Marchand 1 participant 2 messages Jan 3, 2023 – Jan 31, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbarray: fix metadata dump

If the passed fbarray is invalid, its lock was not taken before releasing.

Fixes c44d09811b40 ("eal: add shared indexed file-backed array")
---
 lib/eal/common/eal_common_fbarray.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/eal/common/eal_common_fbarray.c +1 -2
index f11f87979f..169e66e04b 100644
@@ -1482,7 +1482,7 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
 
 	if (fully_validate(arr->name, arr->elt_sz, arr->len)) {
 		fprintf(f, "Invalid file-backed array\n");
-		goto out;
+		return;
 	}
 
 	/* prevent array from changing under us */
@@ -1496,6 +1496,5 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)
 
 	for (i = 0; i < msk->n_masks; i++)
 		fprintf(f, "msk idx %i: 0x%016" PRIx64 "\n", i, msk->data[i]);
-out:
 	rte_rwlock_read_unlock(&arr->rwlock);
 }
Signature · 1 line
2.39.0