* [PATCH 19.11] net/bonding: fix memory leak on closing device
@ 2021-12-08 8:19 dapengx.yu
0 siblings, 0 replies; only message in thread
From: dapengx.yu @ 2021-12-08 8:19 UTC (permalink / raw)
To: stable; +Cc: Dapeng Yu
From: Dapeng Yu <dapengx.yu@intel.com>
[ 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 <dapengx.yu@intel.com>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-08 8:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 8:19 [PATCH 19.11] net/bonding: fix memory leak on closing device dapengx.yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).