[1/3] net/nfb: avoid memory leak on unplug

Message ID 1560783924-5355-2-git-send-email-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev mac_addrs cleanups |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

David Marchand June 17, 2019, 3:05 p.m. UTC
  Clearing mac_addrs on remove will prevent ethdev from freeing it.

Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/nfb/nfb_ethdev.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Ferruh Yigit June 26, 2019, 5:21 p.m. UTC | #1
On 6/17/2019 4:05 PM, David Marchand wrote:
> Clearing mac_addrs on remove will prevent ethdev from freeing it.
> 
> Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

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

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index fdd0e70..6f77864 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -510,8 +510,6 @@ 
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_pci_addr *pci_addr = &pci_dev->addr;
 
-	dev->data->mac_addrs = NULL;
-
 	nfb_nc_rxmac_deinit(internals->rxmac, internals->max_rxmac);
 	nfb_nc_txmac_deinit(internals->txmac, internals->max_txmac);