Skip to content

Commit 652d54e

Browse files
seehearfeelMarc Zyngier
authored andcommitted
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: 818e915 ("irqchip: Add Loongson HyperTransport Vector support") Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 85efd60 commit 652d54e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/irqchip/irq-loongson-htvec.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int htvec_of_init(struct device_node *node,
192192
if (!priv->htvec_domain) {
193193
pr_err("Failed to create IRQ domain\n");
194194
err = -ENOMEM;
195-
goto iounmap_base;
195+
goto irq_dispose;
196196
}
197197

198198
htvec_reset(priv);
@@ -203,6 +203,9 @@ static int htvec_of_init(struct device_node *node,
203203

204204
return 0;
205205

206+
irq_dispose:
207+
for (; i > 0; i--)
208+
irq_dispose_mapping(parent_irq[i - 1]);
206209
iounmap_base:
207210
iounmap(priv->base);
208211
free_priv:

0 commit comments

Comments
 (0)