From f3330a26506ce45fe1b3423c611382c495c0b105 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Tue, 9 Jul 2019 15:00:27 +0100 Subject: [PATCH] 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 --- lib/librte_eal/common/eal_common_fbarray.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c index b7ddb66e9c..1312f936b8 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; -- 2.20.1