From: Oded Gabbay Date: Sun, 4 Sep 2022 07:39:27 +0000 (+0300) Subject: habanalabs/gaudi2: free event irq if init fails X-Git-Tag: v6.1-rc5~262^2~57^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c833ac1a5f34a21e9e9f8605b2f3f9f8dcaab6a0;p=platform%2Fkernel%2Flinux-starfive.git habanalabs/gaudi2: free event irq if init fails In case initialization fails after event irq was requested, we need to release that irq. Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/gaudi2/gaudi2.c b/drivers/misc/habanalabs/gaudi2/gaudi2.c index db18e06..60694b8 100644 --- a/drivers/misc/habanalabs/gaudi2/gaudi2.c +++ b/drivers/misc/habanalabs/gaudi2/gaudi2.c @@ -3581,7 +3581,7 @@ static int gaudi2_enable_msix(struct hl_device *hdev) rc = gaudi2_dec_enable_msix(hdev); if (rc) { dev_err(hdev->dev, "Failed to enable decoder IRQ"); - goto free_completion_irq; + goto free_event_irq; } for (i = GAUDI2_IRQ_NUM_USER_FIRST, j = prop->user_dec_intr_count, user_irq_init_cnt = 0; @@ -3612,6 +3612,10 @@ free_user_irq: gaudi2_dec_disable_msix(hdev, GAUDI2_IRQ_NUM_SHARED_DEC1_ABNRM + 1); +free_event_irq: + irq = pci_irq_vector(hdev->pdev, GAUDI2_IRQ_NUM_EVENT_QUEUE); + free_irq(irq, cq); + free_completion_irq: irq = pci_irq_vector(hdev->pdev, GAUDI2_IRQ_NUM_COMPLETION); free_irq(irq, cq);