mempool: fix stack handler dequeue
The return value of the stack handler is wrong: it should be 0 on success, not the number of objects dequeued. This could lead to memory leaks depending on how the caller checks the return value (ret < 0 or ret != 0). This was also breaking autotests with debug enabled, because the debug cookies are only updated when the function returns 0, so the cookies were not updated, leading to an abort(). Fixes: 295a530b0844 ("mempool: add stack mempool handler") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
parent
3cdfdf2a33
commit
e09ff22d53
@ -118,7 +118,7 @@ stack_dequeue(struct rte_mempool *mp, void **obj_table,
|
||||
|
||||
s->len -= n;
|
||||
rte_spinlock_unlock(&s->sl);
|
||||
return n;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
|
Loading…
x
Reference in New Issue
Block a user