summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2020-07-07 10:12:47 +0800
committerMarc Zyngier <maz@kernel.org>2020-07-17 13:41:42 +0100
commit652d54e77a438cf38a5731d8f9983c81e72dc429 (patch)
tree2b8b0606e379a08ccf7f983acc59d6c0c35f63a5 /drivers
parent85efd6059ae1a99e5e7205f37e910fd41dfa0ade (diff)
downloadlinux-652d54e77a438cf38a5731d8f9983c81e72dc429.tar.bz2
irqchip/loongson-htvec: Fix potential resource leak
In the function htvec_of_init(), system resource "parent_irq" was not released in an error case. Thus add a jump target for the completion of the desired exception handling. Fixes: 818e915fbac5 ("irqchip: Add Loongson HyperTransport Vector support") Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/1594087972-21715-4-git-send-email-yangtiezhu@loongson.cn
Diffstat (limited to 'drivers')
-rw-r--r--drivers/irqchip/irq-loongson-htvec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c
index 1ece9337c78d..b36d40338323 100644
--- a/drivers/irqchip/irq-loongson-htvec.c
+++ b/drivers/irqchip/irq-loongson-htvec.c
@@ -192,7 +192,7 @@ static int htvec_of_init(struct device_node *node,
if (!priv->htvec_domain) {
pr_err("Failed to create IRQ domain\n");
err = -ENOMEM;
- goto iounmap_base;
+ goto irq_dispose;
}
htvec_reset(priv);
@@ -203,6 +203,9 @@ static int htvec_of_init(struct device_node *node,
return 0;
+irq_dispose:
+ for (; i > 0; i--)
+ irq_dispose_mapping(parent_irq[i - 1]);
iounmap_base:
iounmap(priv->base);
free_priv: