[dpdk-stable] patch 'mempool: fix stack handler dequeue' has been queued to stable release 16.11.1

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Feb 15 07:26:42 CET 2017


Hi,

FYI, your patch has been queued to stable release 16.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 02/18/17.
So please shout if anyone has objections.

Thanks.

	--yliu

---
>From 99cf175ab607413ec52bb913ff1eb1b92008be98 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz at 6wind.com>
Date: Mon, 23 Jan 2017 18:11:03 +0100
Subject: [PATCH] mempool: fix stack handler dequeue

[ upstream commit e09ff22d538e13ead91a5caa2d136e8e065e5ed1 ]

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")

Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
---
 lib/librte_mempool/rte_mempool_stack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_mempool/rte_mempool_stack.c b/lib/librte_mempool/rte_mempool_stack.c
index 5fd8af2..817f77e 100644
--- a/lib/librte_mempool/rte_mempool_stack.c
+++ b/lib/librte_mempool/rte_mempool_stack.c
@@ -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
-- 
1.9.0



More information about the stable mailing list