wifi: mwifiex: fix IRQ leak using wrong index in MSI-X error path
PATCH 1/1 wifi: mwifiex: fix IRQ leak using wrong index in MSI-X error path
mwifiex_pcie_request_irq() registers each MSI-X vector with a per-index dev_id (&card->msix_ctx[i]). On a request_irq() failure the cleanup loop "for (j = 0; j < i; j++)" frees msix_entries[j].vector but passes the failed index's &card->msix_ctx[i] as the dev_id. free_irq() matches on (irq, dev_id), so it fails to find the action registered with &card->msix_ctx[j]: the already-requested IRQ j is not freed (leaked) and free_irq() warns about freeing a non-existent IRQ. Use &card->msix_ctx[j].
Fixes 99074fc1e67b ("mwifiex: enable pcie MSIx interrupt mode support")
Signed-off-by Peng Hao <[email protected]>
--- drivers/net/wireless/marvell/mwifiex/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/pcie.c +1 -1
@@ -3068,7 +3068,7 @@ static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter) ret);for (j =0 ; j < i; j++)free_irq (card->msix_entries[j].vector, - &card->msix_ctx[i]); + &card->msix_ctx[j]);pci_disable_msix (pdev); }else {mwifiex_dbg (adapter,MSG ,"MSIx enabled!" );
Signature · 1 line
2.43.7