mem: fix index for unmapping segments on failure
authorAnatoly Burakov <anatoly.burakov@intel.com>
Thu, 3 May 2018 10:11:25 +0000 (11:11 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 14 May 2018 01:15:33 +0000 (03:15 +0200)
commitb3b1b83bad2f6258be866a3687c0cf1bf6b0668c
tree2191ba5cd17ce95091e17b0c58477990c6413837
parentd2bd796d7bd45f6a14eeb68cd4b5faee244f11ec
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 <anatoly.burakov@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_eal/linuxapp/eal/eal_memalloc.c