Skip to content

Commit 9fc899c

Browse files
Souptick Joarder (HPE)gregkh
authored andcommitted
irqchip/nvic: Release nvic_base upon failure
[ Upstream commit e414c25 ] smatch warning was reported as below -> smatch warnings: drivers/irqchip/irq-nvic.c:131 nvic_of_init() warn: 'nvic_base' not released on lines: 97. Release nvic_base upon failure. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Souptick Joarder (HPE) <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 4bbd910 commit 9fc899c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/irqchip/irq-nvic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static int __init nvic_of_init(struct device_node *node,
9494

9595
if (!nvic_irq_domain) {
9696
pr_warn("Failed to allocate irq domain\n");
97+
iounmap(nvic_base);
9798
return -ENOMEM;
9899
}
99100

@@ -103,6 +104,7 @@ static int __init nvic_of_init(struct device_node *node,
103104
if (ret) {
104105
pr_warn("Failed to allocate irq chips\n");
105106
irq_domain_remove(nvic_irq_domain);
107+
iounmap(nvic_base);
106108
return ret;
107109
}
108110

0 commit comments

Comments
 (0)