mempool: fix crash when handler not found
authorShreyansh Jain <shreyansh.jain@nxp.com>
Fri, 31 Mar 2017 05:35:35 +0000 (11:05 +0530)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 3 Apr 2017 16:53:10 +0000 (18:53 +0200)
commit44cebef721a644dd4139596942d24d0967c1cfb3
tree01e10ec179275a09fdf65394b9fa1ac08c83bf0b
parent240e992f74f570913898212bd137b7bb3db3d054
mempool: fix crash when handler not found

In case the stack or ring mempool handler are compiled as shared
library and not linked in with test binary, segfault is reported.
This is because return value of rte_mempool_set_ops_byname is not
being checked in rte_mempool_ops_alloc.

This patch handles error returned from rte_mempool_set_ops_byname
when a mempool is not found.

Fixes: 449c49b93a6b ("mempool: support handler operations")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mempool/rte_mempool.c