From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1099837B8 for ; Tue, 15 Nov 2016 12:39:49 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP; 15 Nov 2016 03:39:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,494,1473145200"; d="scan'208";a="31499435" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 15 Nov 2016 03:39:44 -0800 From: Yuanhan Liu To: Wei Dai Cc: Yuanhan Liu , =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Date: Tue, 15 Nov 2016 19:40:23 +0800 Message-Id: <1479210033-24775-3-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1479210033-24775-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1479210033-24775-1-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'lpm: fix freeing memory' has been queued to stable release 16.07.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 11:39:50 -0000 Hi, FYI, your patch has been queued to stable release 16.07.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/19/16. So please shout if anyone has objections. Thanks. --yliu --- >>From 6c7778fd4e31b7fc8940b462becb0c441c25c052 Mon Sep 17 00:00:00 2001 From: Wei Dai Date: Thu, 3 Nov 2016 18:15:59 +0800 Subject: [PATCH] lpm: fix freeing memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit c7e9d6a6ed90a022067f42727d5d1675a3f3df11 ] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The memory pointed by lpm->rules_tbl should also be freed when memory malloc for tbl8 fails in rte_lpm_create_v1604( ). And the memory pointed by lpm->tbl8 should also be freed when the lpm object is freed in rte_lpm_free_v1604( ). Fixes: f1f7261838b3 ("lpm: add a new config structure for IPv4") Signed-off-by: Morten Brørup Signed-off-by: Wei Dai --- lib/librte_lpm/rte_lpm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index 24fec4b..e1b5d94 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -321,6 +321,7 @@ rte_lpm_create_v1604(const char *name, int socket_id, if (lpm->tbl8 == NULL) { RTE_LOG(ERR, LPM, "LPM tbl8 memory allocation failed\n"); + rte_free(lpm->rules_tbl); rte_free(lpm); lpm = NULL; rte_free(te); @@ -402,6 +403,7 @@ rte_lpm_free_v1604(struct rte_lpm *lpm) rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_free(lpm->tbl8); rte_free(lpm->rules_tbl); rte_free(lpm); rte_free(te); -- 1.9.0