Skip to content

Commit 87c9781

Browse files
tititiou36kuba-moo
authored andcommitted
octeontx2-af: cn10k: mcs: Fix a resource leak in the probe and remove functions
In mcs_register_interrupts(), a call to request_irq() is not balanced by a corresponding free_irq(), neither in the error handling path, nor in the remove function. Add the missing calls. Fixes: 6c635f7 ("octeontx2-af: cn10k: mcs: Handle MCS block interrupts") Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/69f153db5152a141069f990206e7389f961d41ec.1670693669.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a38a211 commit 87c9781

File tree

1 file changed

+5
-1
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

1 file changed

+5
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/af/mcs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,10 +1184,13 @@ static int mcs_register_interrupts(struct mcs *mcs)
11841184
mcs->tx_sa_active = alloc_mem(mcs, mcs->hw->sc_entries);
11851185
if (!mcs->tx_sa_active) {
11861186
ret = -ENOMEM;
1187-
goto exit;
1187+
goto free_irq;
11881188
}
11891189

11901190
return ret;
1191+
1192+
free_irq:
1193+
free_irq(pci_irq_vector(mcs->pdev, MCS_INT_VEC_IP), mcs);
11911194
exit:
11921195
pci_free_irq_vectors(mcs->pdev);
11931196
mcs->num_vec = 0;
@@ -1589,6 +1592,7 @@ static void mcs_remove(struct pci_dev *pdev)
15891592

15901593
/* Set MCS to external bypass */
15911594
mcs_set_external_bypass(mcs, true);
1595+
free_irq(pci_irq_vector(pdev, MCS_INT_VEC_IP), mcs);
15921596
pci_free_irq_vectors(pdev);
15931597
pci_release_regions(pdev);
15941598
pci_disable_device(pdev);

0 commit comments

Comments
 (0)