Skip to content

Commit

Permalink
fbarray: fix metadata dump
Browse files Browse the repository at this point in the history
[ upstream commit 70eb4069b05c82494155a89eb8d08d8d2f57b059 ]

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

Fixes: c44d098 ("eal: add shared indexed file-backed array")

Signed-off-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
david-marchand authored and bluca committed Feb 22, 2023
1 parent 09162b9 commit 10b9f45
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/librte_eal/common/eal_common_fbarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,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 */
Expand All @@ -1499,6 +1499,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);
}

0 comments on commit 10b9f45

Please sign in to comment.