Skip to contentSkip to conversation

octeontx2-pf: Fix memory leak during interface down

PATCH Applied Suman Ghosh 3 participants 3 messages Nov 17, 2023 – Nov 19, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 octeontx2-pf: Fix memory leak during interface down

During 'ifconfig <netdev> down' one RSS memory was not getting freed. This patch fixes the same.

Fixes 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")

---
v2 changes:
- Updated fixes tag

 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +2 -0
index 91b99fd70361..ba95ac913274 100644
@@ -1934,6 +1934,8 @@ int otx2_stop(struct net_device *netdev)
 	/* Clear RSS enable flag */
 	rss = &pf->hw.rss_info;
 	rss->enable = false;
+	if (!netif_is_rxfh_configured(netdev))
+		kfree(rss->rss_ctx[DEFAULT_RSS_CONTEXT_GROUP]);
 
 	/* Cleanup Queue IRQ */
 	vec = pci_irq_vector(pf->pdev,
Signature · 1 line
2.25.1
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Suman Ghosh

During 'ifconfig <netdev> down' one RSS memory was not getting freed. This patch fixes the same.

Fixes 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")

---
v2 changes:
- Updated fixes tag

Thanks for the update, this now looks good to me.

#2 lore raw
In reply to Suman Ghosh
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 10 lines · On Fri, 17 Nov 2023 16:10:18 +0530 you wrote:

During 'ifconfig <netdev> down' one RSS memory was not getting freed. This patch fixes the same.

Fixes 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")

---
v2 changes:
- Updated fixes tag

[...]

Here is the summary with links:
- [net,v2] octeontx2-pf: Fix memory leak during interface down

    https://git.kernel.org/netdev/net/c/5f228d7c8a53

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html