mempool: fix unsafe removal from list by callback
authorThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 25 Jul 2016 19:32:03 +0000 (21:32 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 25 Jul 2016 20:20:51 +0000 (22:20 +0200)
commitcae54ac47cedbf9836a09dc61fbb85bd4ac8afd1
treea4c05acd4f969f97f1a897dd9801b3df12c7ec47
parent3cb6bdc761409b1c740340a6a9ab71af66a2c1fe
mempool: fix unsafe removal from list by callback

If a mempool is removed from the list by a callback function
during rte_mempool_walk(), the TAILQ_FOREACH loop will fail unexpectedly.
It is fixed by using the safe version of the loop macro.

Reported-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mempool/rte_mempool.c