* [PATCH net] octeontx2-pf: mcs: fix possible memory leak in otx2_probe()
@ 2022-10-10 3:39 Yang Yingliang
2022-10-10 7:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-10-10 3:39 UTC (permalink / raw)
To: netdev; +Cc: sbhatta, sgoutham, davem
In error path after calling cn10k_mcs_init(), cn10k_mcs_free() need
be called to avoid memory leak.
Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
Signed-off-by: Yang Yingliang <yangyingliang@huawei•com>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 5803d7f9137c..892ca88e0cf4 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -2810,7 +2810,7 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = register_netdev(netdev);
if (err) {
dev_err(dev, "Failed to register netdevice\n");
- goto err_del_mcam_entries;
+ goto err_mcs_free;
}
err = otx2_wq_init(pf);
@@ -2849,6 +2849,8 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)
otx2_mcam_flow_del(pf);
err_unreg_netdev:
unregister_netdev(netdev);
+err_mcs_free:
+ cn10k_mcs_free(pf);
err_del_mcam_entries:
otx2_mcam_flow_del(pf);
err_ptp_destroy:
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] octeontx2-pf: mcs: fix possible memory leak in otx2_probe()
2022-10-10 3:39 [PATCH net] octeontx2-pf: mcs: fix possible memory leak in otx2_probe() Yang Yingliang
@ 2022-10-10 7:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-10-10 7:50 UTC (permalink / raw)
To: Yang Yingliang; +Cc: netdev, sbhatta, sgoutham, davem
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft•net>:
On Mon, 10 Oct 2022 11:39:45 +0800 you wrote:
> In error path after calling cn10k_mcs_init(), cn10k_mcs_free() need
> be called to avoid memory leak.
>
> Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei•com>
> ---
> drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Here is the summary with links:
- [net] octeontx2-pf: mcs: fix possible memory leak in otx2_probe()
https://git.kernel.org/netdev/net/c/af7d23f9d96a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-10 7:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10 3:39 [PATCH net] octeontx2-pf: mcs: fix possible memory leak in otx2_probe() Yang Yingliang
2022-10-10 7:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox