From: Anatoly Burakov Date: Thu, 3 May 2018 10:11:25 +0000 (+0100) Subject: mem: fix index for unmapping segments on failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b3b1b83bad2f6258be866a3687c0cf1bf6b0668c;p=dpdk.git mem: fix index for unmapping segments on failure Segment index was calculated incorrectly, causing free_seg to attempt to free segments that do not exist. Fixes: a5ff05d60fc5 ("mem: support unmapping pages at runtime") Signed-off-by: Anatoly Burakov Tested-by: Yong Liu Acked-by: Konstantin Ananyev --- diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c index ace2bcf3e9..f687c4c72d 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c @@ -735,8 +735,7 @@ alloc_seg_walk(const struct rte_memseg_list *msl, void *arg) &cur_msl->memseg_arr; tmp = rte_fbarray_get(arr, j); - if (free_seg(tmp, wa->hi, msl_idx, - start_idx + j)) { + if (free_seg(tmp, wa->hi, msl_idx, j)) { RTE_LOG(ERR, EAL, "Cannot free page\n"); continue; }