fbarray: fix metadata dump
Checks
Commit Message
If the passed fbarray is invalid, its lock was not taken before
releasing.
Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/eal/common/eal_common_fbarray.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Tue, Jan 3, 2023 at 11:49 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> If the passed fbarray is invalid, its lock was not taken before
> releasing.
>
> Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Applied.
@@ -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);
}