mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irqchip: nvic: release nvic_base upon failure
@ 2022-02-18 16:33 Souptick Joarder
  2022-03-01  3:13 ` Souptick Joarder
  2022-03-01 18:27 ` [irqchip: irq/irqchip-next] irqchip/nvic: Release " irqchip-bot for Souptick Joarder (HPE)
  0 siblings, 2 replies; 3+ messages in thread
From: Souptick Joarder @ 2022-02-18 16:33 UTC (permalink / raw)
  To: tglx, maz
  Cc: linux-kernel, Souptick Joarder (HPE), kernel test robot, Dan Carpenter

From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>

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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
---
 drivers/irqchip/irq-nvic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-nvic.c b/drivers/irqchip/irq-nvic.c
index 125f9c1cf0c3..ba6332b00a0a 100644
--- a/drivers/irqchip/irq-nvic.c
+++ b/drivers/irqchip/irq-nvic.c
@@ -94,6 +94,7 @@ static int __init nvic_of_init(struct device_node *node,
 
 	if (!nvic_irq_domain) {
 		pr_warn("Failed to allocate irq domain\n");
+		iounmap(nvic_base);
 		return -ENOMEM;
 	}
 
@@ -103,6 +104,7 @@ static int __init nvic_of_init(struct device_node *node,
 	if (ret) {
 		pr_warn("Failed to allocate irq chips\n");
 		irq_domain_remove(nvic_irq_domain);
+		iounmap(nvic_base);
 		return ret;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-01 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18 16:33 [PATCH] irqchip: nvic: release nvic_base upon failure Souptick Joarder
2022-03-01  3:13 ` Souptick Joarder
2022-03-01 18:27 ` [irqchip: irq/irqchip-next] irqchip/nvic: Release " irqchip-bot for Souptick Joarder (HPE)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome