summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2022-09-04 10:39:27 +0300
committerOded Gabbay <ogabbay@kernel.org>2022-09-19 15:08:38 +0300
commitc833ac1a5f34a21e9e9f8605b2f3f9f8dcaab6a0 (patch)
tree3a15c61de92ea7b7f41d5f812010565d5f65d04c /drivers/misc
parent76925f55c9ba46faaf4054a8192dc5814bc2e0ab (diff)
downloadlinux-c833ac1a5f34a21e9e9f8605b2f3f9f8dcaab6a0.tar.gz
linux-c833ac1a5f34a21e9e9f8605b2f3f9f8dcaab6a0.tar.bz2
linux-c833ac1a5f34a21e9e9f8605b2f3f9f8dcaab6a0.zip
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 <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/gaudi2/gaudi2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/gaudi2/gaudi2.c b/drivers/misc/habanalabs/gaudi2/gaudi2.c
index db18e066509c..60694b8ed6fe 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);