ethernet: marvell: octeontx2 Fix resource not freed after malloc
PATCH 1/1 ethernet: marvell: octeontx2 Fix resource not freed after malloc
fix rxsc not getting freed before going out of scope
--- drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +1 -0
@@ -870,6 +870,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf)cn10k_mcs_free_rsrc (pfvf,MCS_RX ,MCS_RSRC_TYPE_FLOWID , rxsc->hw_flow_id, false); fail: +kfree (rxsc);return ERR_PTR (ret); }
Signature · 1 line
2.38.0
Hi,
Quoted 15 lines · Manank Patel
fix rxsc not getting freed before going out of scope
Fixes c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")Signed-off-by Manank Patel <[email protected]>--- drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +0
-0
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf) · line 873
Quoted 4 lines
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +1
-0@@ -870,6 +870,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf)cn10k_mcs_free_rsrc (pfvf,MCS_RX ,MCS_RSRC_TYPE_FLOWID , rxsc->hw_flow_id, false); fail: +kfree (rxsc);
Thanks for the fix. Can you do the same in cn10k_mcs_create_txsc as well.
Sundeep
Quoted 6 lines
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +0
-1return ERR_PTR (ret); } --2.38.0
PATCH v2 1/1 ethernet: marvell: octeontx2 Fix resource not freed after malloc
fix rxsc and txsc not getting freed before going out of scope
---
Changelog
v1->v2:
add the same fix in cn10k_mcs_create_txsc
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +2 -0
@@ -815,6 +815,7 @@ static struct cn10k_mcs_txsc *cn10k_mcs_create_txsc(struct otx2_nic *pfvf)cn10k_mcs_free_rsrc (pfvf,MCS_TX ,MCS_RSRC_TYPE_FLOWID , txsc->hw_flow_id, false); fail: +kfree (txsc);return ERR_PTR (ret); }
@@ -870,6 +871,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf)cn10k_mcs_free_rsrc (pfvf,MCS_RX ,MCS_RSRC_TYPE_FLOWID , rxsc->hw_flow_id, false); fail: +kfree (rxsc);return ERR_PTR (ret); }
Signature · 1 line
2.38.0
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Tue, 18 Oct 2022 11:03:18 +0530 you wrote:
fix rxsc and txsc not getting freed before going out of scope
Fixes c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")Signed-off-by Manank Patel <[email protected]>---
[...]
Here is the summary with links:
- [v2] ethernet: marvell: octeontx2 Fix resource not freed after malloc
https://git.kernel.org/netdev/net/c/7b55c2ed2ba0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html