summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Burakov <anatoly.burakov@intel.com>2019-07-09 15:00:27 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-07-10 23:27:46 +0200
commitf3330a26506ce45fe1b3423c611382c495c0b105 (patch)
tree07e36bea83b365ae88c6405de5579ca58fe1c685
parent89aac60e0be9ed95a87b16e3595f102f9faaffb4 (diff)
downloaddpdk-f3330a26506ce45fe1b3423c611382c495c0b105.zip
dpdk-f3330a26506ce45fe1b3423c611382c495c0b105.tar.gz
dpdk-f3330a26506ce45fe1b3423c611382c495c0b105.tar.xz
fbarray: fix destruction
Currently, when fbarray is destroyed, the fbarray structure is not zeroed out, which leads to stale data being there and confusing secondary process init in legacy mem mode. Fix it by always memsetting the fbarray to zero when destroying it. Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
-rw-r--r--lib/librte_eal/common/eal_common_fbarray.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
index b7ddb66..1312f93 100644
--- a/lib/librte_eal/common/eal_common_fbarray.c
+++ b/lib/librte_eal/common/eal_common_fbarray.c
@@ -1055,6 +1055,9 @@ rte_fbarray_destroy(struct rte_fbarray *arr)
TAILQ_REMOVE(&mem_area_tailq, tmp, next);
free(tmp);
ret = 0;
+
+ /* reset the fbarray structure */
+ memset(arr, 0, sizeof(*arr));
out:
rte_spinlock_unlock(&mem_area_lock);
return ret;