net/nfb: fix eth_node memory leak in deinit
PATCH 1/1 net/nfb: fix eth_node memory leak in deinit
The eth_node array allocated with calloc() in nfb_nc_eth_init() is freed on the error path but not in the normal teardown path via nfb_nc_eth_deinit(). Add the missing free().
Fixes 9b173c0f89 ("net/nfb: get correct link speed")
Signed-off-by Stephen Hemminger <[email protected]>
--- drivers/net/nfb/nfb_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/nfb/nfb_ethdev.c +1 -0
@@ -186,6 +186,7 @@ nfb_nc_eth_deinit(struct pmd_internals *intl)for (i =0 ; i < intl->max_rxmac; i++)nc_rxmac_close (intl->rxmac[i]); +free (intl->eth_node);free (intl->txmac);free (intl->rxmac); }
Signature · 1 line
2.51.0
Thank you. Can be squashed, but it's OK this way.
Acked-by Martin Spinler <[email protected]>
Quoted 23 lines · Stephen Hemminger
The
eth_nodearray allocated withcalloc()innfb_nc_eth_init()is freed on the error path but not in the normal teardown path vianfb_nc_eth_deinit(). Add the missingfree().Fixes 9b173c0f89 ("net/nfb: get correct link speed")Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/nfb/nfb_ethdev.c | 1 + 1 file changed, 1 insertion(+)drivers/net/nfb/nfb_ethdev.c +1
-0@@ -186,6 +186,7 @@ nfb_nc_eth_deinit(struct pmd_internals *intl)for (i =0 ; i < intl->max_rxmac; i++)nc_rxmac_close (intl->rxmac[i]); +free (intl->eth_node);free (intl->txmac);free (intl->rxmac); }