diff mbox series

net/bonding: fix kvlist memory leakage

Message ID 1619057102-4154-1-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series net/bonding: fix kvlist memory leakage | expand

Checks

Context Check Description
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) April 22, 2021, 2:05 a.m. UTC
From: Chengwen Feng <fengchengwen@huawei.com>

If the bond device was created by vdev mode, the kvlist was not free
when the bond device removed.

Fixes: 8d30fe7fa737 ("bonding: support port hotplug")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ferruh Yigit April 26, 2021, 1:05 p.m. UTC | #1
On 4/22/2021 3:05 AM, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> If the bond device was created by vdev mode, the kvlist was not free
> when the bond device removed.
> 
> Fixes: 8d30fe7fa737 ("bonding: support port hotplug")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.
diff mbox series

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 2e9cea5..25b1f77 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3467,6 +3467,8 @@  bond_remove(struct rte_vdev_device *dev)
 		ret = bond_ethdev_stop(eth_dev);
 		bond_ethdev_close(eth_dev);
 	}
+	if (internals->kvlist != NULL)
+		rte_kvargs_free(internals->kvlist);
 	rte_eth_dev_release_port(eth_dev);
 
 	return ret;