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.

Signed-off-by: Thomas Fourier <[email protected]>
Fixes: c833ac1a5f34 ("habanalabs/gaudi2: free event irq if init fails")
---
 drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c 
b/drivers/accel/habanalabs/gaudi2/gaudi2.c
index 5d9c6f0698b7..b082d7eb6c45 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
@@ -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);
-- 
2.53.0

Reply via email to