From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D66E79E7 for ; Wed, 15 Feb 2017 07:25:10 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 22:25:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,164,1484035200"; d="scan'208";a="1094927650" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 14 Feb 2017 22:25:09 -0800 From: Yuanhan Liu To: Olivier Matz Cc: Yuanhan Liu , dpdk stable Date: Wed, 15 Feb 2017 14:26:42 +0800 Message-Id: <1487140012-13314-30-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-stable] patch 'mempool: fix stack handler dequeue' has been queued to stable release 16.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 06:25:11 -0000 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 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 --- 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