| From 5c9a2a4fa35d4f4273304f724b177dfbd1c130e4 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Fri, 6 Feb 2026 23:56:45 +0530 |
| Subject: octeontx2-pf: Unregister devlink on probe failure |
| |
| From: Hariprasad Kelam <hkelam@marvell.com> |
| |
| [ Upstream commit 943f3b8bfbf297cf74392b50a7108ce1fe4cbd8c ] |
| |
| When probe fails after devlink registration, the missing devlink unregister |
| call causing a memory leak. |
| |
| Fixes: 2da489432747 ("octeontx2-pf: devlink params support to set mcam entry count") |
| Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> |
| Link: https://patch.msgid.link/20260206182645.4032737-1-hkelam@marvell.com |
| Signed-off-by: Paolo Abeni <pabeni@redhat.com> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c |
| index 5f093b34db698..803f40a2bdc19 100644 |
| --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c |
| +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c |
| @@ -2777,6 +2777,7 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
| return 0; |
| |
| err_pf_sriov_init: |
| + otx2_unregister_dl(pf); |
| otx2_shutdown_tc(pf); |
| err_mcam_flow_del: |
| otx2_mcam_flow_del(pf); |
| -- |
| 2.51.0 |
| |