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 <anatoly.burakov@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit is contained in:
Anatoly Burakov 2018-05-03 11:11:26 +01:00 committed by Thomas Monjalon
parent b3b1b83bad
commit 3d2d9861a6

View File

@ -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 {