memp: Fix memp_overflow_check_all failure

p needs to point to LWIP_MEM_ALIGN(memp_pools[i]->base) otherwise it will cause
assertion in overflow checking.

Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2016-11-04 09:01:58 +08:00 committed by Dirk Ziegelmeier
parent d4384cfac4
commit 1a7ba24d13

View File

@ -205,7 +205,7 @@ memp_overflow_check_all(void)
SYS_ARCH_PROTECT(old_level); SYS_ARCH_PROTECT(old_level);
for (i = 0; i < MEMP_MAX; ++i) { for (i = 0; i < MEMP_MAX; ++i) {
p = (struct memp *)(size_t)(memp_pools[i]->base); p = (struct memp*)LWIP_MEM_ALIGN(memp_pools[i]->base);
for (j = 0; j < memp_pools[i]->num; ++j) { for (j = 0; j < memp_pools[i]->num; ++j) {
memp_overflow_check_element_overflow(p, memp_pools[i]); memp_overflow_check_element_overflow(p, memp_pools[i]);
memp_overflow_check_element_underflow(p, memp_pools[i]); memp_overflow_check_element_underflow(p, memp_pools[i]);