From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 354BCA00C5 for ; Wed, 8 Dec 2021 09:20:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02FD1410E8; Wed, 8 Dec 2021 09:20:54 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 50765410E8 for ; Wed, 8 Dec 2021 09:20:52 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10191"; a="238010901" X-IronPort-AV: E=Sophos;i="5.87,296,1631602800"; d="scan'208";a="238010901" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2021 00:20:51 -0800 X-IronPort-AV: E=Sophos;i="5.87,296,1631602800"; d="scan'208";a="502962547" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2021 00:20:49 -0800 From: dapengx.yu@intel.com To: stable@dpdk.org Cc: Dapeng Yu Subject: [PATCH 19.11] net/bonding: fix memory leak on closing device Date: Wed, 8 Dec 2021 16:19:44 +0800 Message-Id: <20211208081944.310079-1-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Dapeng Yu [ upstream commit ccf0f002d2ec5455102c0259f44535944aa4b154 ] If the bond device was created by vdev mode, the kvlist was not free after the bond device was closed. This patch fixes it. Fixes: 144dc4739975 ("net/bonding: fix leak on remove") Signed-off-by: Dapeng Yu --- drivers/net/bonding/rte_eth_bond_pmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 56e18bad9e..b3647b334e 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2119,6 +2119,9 @@ bond_ethdev_close(struct rte_eth_dev *dev) bond_flow_ops.flush(dev, &ferror); bond_ethdev_free_queues(dev); rte_bitmap_reset(internals->vlan_filter_bmp); + + if (internals->kvlist != NULL) + rte_kvargs_free(internals->kvlist); } /* forward declaration */ @@ -3448,8 +3451,6 @@ bond_remove(struct rte_vdev_device *dev) rte_bitmap_free(internals->vlan_filter_bmp); rte_free(internals->vlan_filter_bmpmem); - if (internals->kvlist != NULL) - rte_kvargs_free(internals->kvlist); rte_eth_dev_release_port(eth_dev); return 0; -- 2.27.0