mem: fix malloc element free in debug mode
authorXueming Li <xuemingl@mellanox.com>
Sat, 9 Sep 2017 07:33:19 +0000 (15:33 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 9 Oct 2017 21:15:45 +0000 (23:15 +0200)
commit41baec55a81467d7733217cd6f81a94e2916348c
tree9d2799438ef4dc3d85cb32ceda76e3a6d78400f5
parent3cd4e0e88349510413c90e2602c8fd7a14cfe6ab
mem: fix malloc element free in debug mode

malloc_elem_free() is clearing(setting to 0) the trailer cookie when
RTE_MALLOC_DEBUG is enabled. In case of joining free neighbor element,
part of joined memory is not getting cleared due to missing the length
of trailer cookie in the middle.

This patch fixes calculation of free memory length to be cleared in
malloc_elem_free() by including trailer cookie.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
lib/librte_eal/common/malloc_elem.c