linux-kernel.vger.kernel.org archive mirror
 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 related	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: nvic: release nvic_base upon failure
  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)
  1 sibling, 0 replies; 3+ messages in thread
From: Souptick Joarder @ 2022-03-01  3:13 UTC (permalink / raw)
  To: Thomas Gleixner, maz; +Cc: linux-kernel, kernel test robot, Dan Carpenter

On Fri, Feb 18, 2022 at 10:03 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> 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.

Any comments on this patch ?

>
> 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

* [irqchip: irq/irqchip-next] irqchip/nvic: Release nvic_base upon failure
  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-bot for Souptick Joarder (HPE)
  1 sibling, 0 replies; 3+ messages in thread
From: irqchip-bot for Souptick Joarder (HPE) @ 2022-03-01 18:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel test robot, Dan Carpenter, Souptick Joarder (HPE),
	Marc Zyngier, tglx

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) <jrdr.linux@gmail.com>
AuthorDate:    Fri, 18 Feb 2022 22:03:03 +05:30
Committer:     Marc Zyngier <maz@kernel.org>
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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220218163303.33344-1-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 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;
 	}
 

^ permalink raw reply related	[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;
as well as URLs for NNTP newsgroup(s).