From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 570612C72 for ; Sun, 6 May 2018 08:37:40 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EC75421C8F; Sun, 6 May 2018 02:37:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 06 May 2018 02:37:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Px9einxs0IgfWFXWC IW6yO8/A9PbEycHhp8fqBuj1R4=; b=pCfuPYtatBBJby0kymHrILXio6g/9vj2V RlKT+VNJSvvCa1TXLt+DvWuMxWxcwBtyg8kzhdOYaP1BC2uUEmuj9DeuhFw9keEq aWtV54IpxLO13rsjfVEIwLCt0WETe2xC/ZTkcfWISpH+wQddjXwqLa2dX/QGwWMS riuRx83oWe0YOuBsCQV25PdepHzIqMlfJXzweyN2aNaawHlu9/V9apHIj8+MpMKC KHvgW+SMsLCfe9EEx2dY375O/uBI0k586R1BKz3m6XSwHa2Tu/WqDhG0988Ha8rd DrOiCgo2IZ4PJTsPPEHbaAQsvQjYlIk+I+Wo8vXOjv2Siu3CmhAPw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Px9einxs0IgfWFXWCIW6yO8/A9PbEycHhp8fqBuj1R4=; b=gOG3fSdO fmcgKY0krunqMLGST1Opv6Ow/kHo7zsm2+p6P3uUSbMxzm0WY8KRdVgNNRbacgks SesKSYyqWnnu3tsZMxwgUFOwiHMlYfLJUyuiHxLva0utdvnNQ/DRfIv4nDi0j7KX uopTERK+Jbu2S8dtae5+pC6iiO70ubOZdlfN26q5kAcuBc1/DeL6TGbWA1QFsCke mrD5n4ZkPNpL1zRpX7KlUomgUYne8WfZzHXLX359vZ8kfkTXl28CuEKTCofpw7cx zK8+GSB8Dhm56TgX2jWi7q+cL5F6ayePOTd5nfo3f2ancBTvHGoylmJ0v7il2n/F 8isw7U41Ukk/Jw== X-ME-Sender: Received: from yuanhanliu-NB0.tencent.com (unknown [223.74.148.102]) by mail.messagingengine.com (Postfix) with ESMTPA id 363C610253; Sun, 6 May 2018 02:37:37 -0400 (EDT) From: Yuanhan Liu To: Andrew Rybchenko Cc: Olivier Matz , dpdk stable Date: Sun, 6 May 2018 14:36:22 +0800 Message-Id: <20180506063639.23196-9-yliu@fridaylinux.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180506063639.23196-1-yliu@fridaylinux.org> References: <20180506063639.23196-1-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'mempool: fix leak when no objects are populated' has been queued to LTS release 17.11.3 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: Sun, 06 May 2018 06:37:40 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/09/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 383a388cb2287fff950d68a95252e985476168bf Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Mon, 16 Apr 2018 14:24:30 +0100 Subject: [PATCH] mempool: fix leak when no objects are populated [ upstream commit 25e6755056eaba45921b898b9986af68277ac6ac ] Fixes: 84121f197187 ("mempool: store memory chunks in a list") Suggested-by: Olivier Matz Signed-off-by: Andrew Rybchenko Acked-by: Olivier Matz --- lib/librte_mempool/rte_mempool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 5bd74eac8..5bb286a41 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -437,12 +437,18 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, } /* not enough room to store one object */ - if (i == 0) - return -EINVAL; + if (i == 0) { + ret = -EINVAL; + goto fail; + } STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next); mp->nb_mem_chunks++; return i; + +fail: + rte_free(memhdr); + return ret; } int -- 2.11.0