From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 409021B1BA for ; Wed, 24 Jan 2018 16:36:23 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id ED5DB21F56; Wed, 24 Jan 2018 10:36:22 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:36:22 -0500 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=fm1; bh=VrM24364ZyybJEtkl gh+Qsr5snWvqI7Bkr58wPd+abc=; b=dIYyl7R2OEBckJ5KHvRjaCK4bcmEqk8+z vCnECT7T6nhWh4AnfTaxb8fxgoC8AnMMEVQajH46fX3cjziKHxcCc2KLkWH+wEKm ciQ6uxMPI2EPu5iTcQoLcnwCsdHk8nehltQ+MMVbIsR/jw1ZPvgvsZPfzyulaxdJ uTVNpfu2vLPuOnBMlhp4phZYx5Dzo0p1I0imhOFB6FyUwy+X6LED82CMDxtqXqK3 GB/42X45JGpfu6R6xip7ASUS0hOlg7anCWyVxp6Q5U+mpsT14UWciqy212Zc1lMu ygw6i32IYBXHyajr7swuq5HM8K0YIv6bmxsAISnSD8KNYOldZkbgQ== 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= fm1; bh=VrM24364ZyybJEtklgh+Qsr5snWvqI7Bkr58wPd+abc=; b=qwXTdvRe YnhqhW2W+6rSlbi+9BVv6Elff+Njsg5wUwzV4BYMIkkndpz03P0qj6o+uC6L98lD ubzKWsya5Bx2/arobOjaMUsZTE2fpCuM7LbAZwL9SGwD1EGjbw9gC5jzrzFsIF7P z8avXqF4EM5LngY2C2erruduOUv07b8hQMApybdds9KZLub+zTUbWxTY64G0yXpL YMPE7L6EhB0JSnfqycBPa63iePF8py827vF56q2NiRqwL0wpiElEKpoj3A2Sfanx lDFT7LvQ31ki6gk4dtvA3WGkr3vpY9gcM59RWt8H36/XH4kBHRrev1ILrX/VJADB Emcza9nGq5D7WQ== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 381F97E1A2; Wed, 24 Jan 2018 10:36:20 -0500 (EST) From: Yuanhan Liu To: Anatoly Burakov Cc: dpdk stable Date: Wed, 24 Jan 2018 23:31:20 +0800 Message-Id: <1516808026-25523-12-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'memzone: fix leak on allocation error' has been queued to LTS release 17.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, 24 Jan 2018 15:36:23 -0000 Hi, FYI, your patch has been queued to LTS release 17.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 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From e0246c95ec2d5feb9d7709e1c42b83342ced99c8 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 21 Dec 2017 18:07:07 +0000 Subject: [PATCH] memzone: fix leak on allocation error [ upstream commit db22d31a79733f08e974f134c883361fd8641984 ] We check if there's space in config after we allocated the memzone, but if there isn't, we never free it back. This patch adds memzone free if there's no room in memzone config. Fixes: ff909fe21f0a ("mem: introduce memzone freeing") Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memzone.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c index ea072a2..b682b00 100644 --- a/lib/librte_eal/common/eal_common_memzone.c +++ b/lib/librte_eal/common/eal_common_memzone.c @@ -237,7 +237,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len, return NULL; } - const struct malloc_elem *elem = malloc_elem_from_data(mz_addr); + struct malloc_elem *elem = malloc_elem_from_data(mz_addr); /* fill the zone in config */ mz = get_next_free_memzone(); @@ -245,6 +245,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len, if (mz == NULL) { RTE_LOG(ERR, EAL, "%s(): Cannot find free memzone but there is room " "in config!\n", __func__); + malloc_elem_free(elem); rte_errno = ENOSPC; return NULL; } -- 2.7.4