From: "Souptick Joarder (HPE)" <[email protected]>
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]>
---
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
On Fri, Feb 18, 2022 at 10:03 PM Souptick Joarder <[email protected]> wrote:
>
> From: "Souptick Joarder (HPE)" <[email protected]>
>
> 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.
Any comments on this patch ?
>
> Reported-by: kernel test robot <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
> Signed-off-by: Souptick Joarder (HPE) <[email protected]>
> ---
> 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
>
The following commit has been merged into the irq/irqchip-next branch of irqchip:
Commit-ID: e414c25e3399b2b3d7337dc47abccab5c71b7c8f
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/e414c25e3399b2b3d7337dc47abccab5c71b7c8f
Author: Souptick Joarder (HPE) <[email protected]>
AuthorDate: Fri, 18 Feb 2022 22:03:03 +05:30
Committer: Marc Zyngier <[email protected]>
CommitterDate: Tue, 01 Mar 2022 10:19:51
irqchip/nvic: Release nvic_base upon failure
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]
---
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 ba4759b..9423030 100644
--- a/drivers/irqchip/irq-nvic.c
+++ b/drivers/irqchip/irq-nvic.c
@@ -107,6 +107,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;
}
@@ -116,6 +117,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;
}