Skip to contentSkip to conversation

accel/habanalabs/gaudi2: free the event queue IRQ with the right dev_id

PATCH New Thomas Fourier 1 participant 1 message Nov 26

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accel/habanalabs/gaudi2: free the event queue IRQ with the right dev_id

gaudi2_enable_msix() requests the event queue vector with &hdev->event_queue as dev_id, but its error path frees it with the completion queue pointer. free_irq() does not find the action, so the event queue IRQ stays registered while pci_free_irq_vectors() tears the vectors down.

Use the same dev_id as the request.

Fixes c833ac1a5f34 ("habanalabs/gaudi2: free event irq if init fails")
---
 drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/habanalabs/gaudi2/gaudi2.c +1 -1
index 5d9c6f0698b7..b082d7eb6c45 100644
@@ -4761,7 +4761,7 @@ static int gaudi2_enable_msix(struct hl_device *hdev)
 	gaudi2_dec_disable_msix(hdev, GAUDI2_IRQ_NUM_DEC_LAST + 1);
 free_event_irq:
 	irq = pci_irq_vector(hdev->pdev, GAUDI2_IRQ_NUM_EVENT_QUEUE);
-	free_irq(irq, cq);
+	free_irq(irq, &hdev->event_queue);
 
 free_completion_irq:
 	irq = pci_irq_vector(hdev->pdev, GAUDI2_IRQ_NUM_COMPLETION);
Signature · 1 line
2.53.0