memp: Fix memp_overflow_check_element_overflow assertion

Use LWIP_MEM_ALIGN() in memp_overflow_init() to get alignment address for memp.
This fixes assertion in memp_overflow_check_element_overflow when
MEMP_OVERFLOW_CHECK is set.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2016-08-17 20:23:30 +08:00 committed by Dirk Ziegelmeier
parent ef31afb921
commit e24fde05db

View File

@ -215,7 +215,7 @@ memp_overflow_init(const struct memp_desc *desc)
u16_t i;
struct memp *p;
p = (struct memp *)(size_t)(desc->base);
p = (struct memp*)LWIP_MEM_ALIGN(desc->base);
for (i = 0; i < desc->num; ++i) {
memp_overflow_init_element(p, desc);
p = (struct memp*)(size_t)((u8_t*)p + MEMP_SIZE + desc->size + MEMP_SANITY_REGION_AFTER_ALIGNED);