Skip to contentSkip to conversation

i40e: Fix freeing of unitialized misc IRQ vector

PATCH Superseded Mateusz Palczewski 2 participants 2 messages Sep 20, 2021

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40e: Fix freeing of unitialized misc IRQ vector

From: Sylwester Dziedziuch <[email protected]>

When VSI set up failed in i40e_probe() as part of PF switch set up driver was trying to free misc IRQ vectors in i40e_clear_interrupt_scheme. The problem is that at that point misc IRQ vectors were not allocated yet and we get a call trace that driver is trying to free already free IRQ vectors.

Add a check in i40e_free_misc_vector for __I40E_MISC_IRQ_REQUESTED PF state which is only set if misc IRQ vectors were properly initialized.

Fixes c17401a1dd21 ("i40e: use separate state bit for miscellaneous IRQ setup")
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -1
index 000991a..b16ae48 100644
@@ -3987,7 +3987,8 @@ static void i40e_free_misc_vector(struct i40e_pf *pf)
 	wr32(&pf->hw, I40E_PFINT_ICR0_ENA, 0);
 	i40e_flush(&pf->hw);
 
-	if (pf->flags & I40E_FLAG_MSIX_ENABLED && pf->msix_entries) {
+	if (pf->flags & I40E_FLAG_MSIX_ENABLED && pf->msix_entries &&
+	    test_bit(__I40E_MISC_IRQ_REQUESTED, pf->state)) {
 		synchronize_irq(pf->msix_entries[0].vector);
 		free_irq(pf->msix_entries[0].vector, pf);
 		clear_bit(__I40E_MISC_IRQ_REQUESTED, pf->state);
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/1 i40e: Fix freeing of unitialized misc IRQ vector

Dear Sylwester, dear Mateusz,

In the commit message summary: unitialized ? uninitialized

Kind regards,

Paul