From: Anatoly Burakov Date: Thu, 3 May 2018 10:11:26 +0000 (+0100) Subject: mem: fix return code of freeing segment on failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3d2d9861a64dc111d67be3948bbf192f2acffa46;p=dpdk.git mem: fix return code of freeing segment on failure Return value should be zero for success, but if unlock and unlink have succeeded, return value was 1, which triggered failure message in calling code. Fixes: a5ff05d60fc5 ("mem: support unmapping pages at runtime") Signed-off-by: Anatoly Burakov 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 f687c4c72d..220daef290 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c @@ -647,7 +647,7 @@ free_seg(struct rte_memseg *ms, struct hugepage_info *hi, memset(ms, 0, sizeof(*ms)); - return ret; + return ret < 0 ? -1 : 0; } struct alloc_walk_param {