linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/7] irqchip: Fix potential resource leaks
@ 2020-06-23 15:55 Markus Elfring
  2020-06-24  1:44 ` Tiezhu Yang
  0 siblings, 1 reply; 13+ messages in thread
From: Markus Elfring @ 2020-06-23 15:55 UTC (permalink / raw)
  To: Tiezhu Yang, devicetree, linux-mips
  Cc: kernel-janitors, linux-kernel, Huacai Chen, Jason Cooper,
	Jiaxun Yang, Marc Zyngier, Rob Herring, Thomas Gleixner,
	Xuefeng Li

> There exists some potential resource leaks in the error path, fix them.

Will the tag “Fixes” become relevant for the commit message?


…
> +++ 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;
>  	}

Can it helpful to add jump targets so that a bit of exception handling
can be better reused at the end of this function?

Regards,
Markus

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH 0/7] Fix potential resource leaks and do some code cleanups about irqchip
@ 2020-06-23  8:51 Tiezhu Yang
  2020-06-23  8:51 ` [PATCH 1/7] irqchip: Fix potential resource leaks Tiezhu Yang
  0 siblings, 1 reply; 13+ messages in thread
From: Tiezhu Yang @ 2020-06-23  8:51 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Rob Herring
  Cc: Guo Ren, Baruch Siach, Huacai Chen, Jiaxun Yang, Tony Lindgren,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Kukjin Kim,
	Krzysztof Kozlowski, Michal Simek, linux-kernel, devicetree,
	linux-csky, linux-arm-kernel, linux-mips, linux-omap,
	linux-riscv, linux-samsung-soc, Xuefeng Li

When I test the irqchip code of Loongson, I read the related code of other
chips in drivers/irqchip and I find some potential resource leaks in the
error path, I think it is better to fix them. Additionally, do some code
cleanups about Loongson to make it more clean and readable.

Tiezhu Yang (7):
  irqchip: Fix potential resource leaks
  irqchip/loongson-htpic: Remove redundant kfree operation
  irqchip/loongson-htvec: Check return value of
    irq_domain_translate_onecell()
  irqchip/loongson-pch-pic: Check return value of
    irq_domain_translate_twocell()
  irqchip/loongson-pch-msi: Remove unneeded variable
  irqchip/loongson-htpic: Remove unneeded select of I8259
  dt-bindings: interrupt-controller: Fix typos in loongson,liointc.yaml

 .../interrupt-controller/loongson,liointc.yaml     |  4 ++--
 drivers/irqchip/Kconfig                            |  1 -
 drivers/irqchip/irq-ath79-misc.c                   |  3 +++
 drivers/irqchip/irq-csky-apb-intc.c                |  3 +++
 drivers/irqchip/irq-csky-mpintc.c                  | 26 +++++++++++++++++-----
 drivers/irqchip/irq-davinci-aintc.c                | 17 ++++++++++----
 drivers/irqchip/irq-davinci-cp-intc.c              | 17 +++++++++++---
 drivers/irqchip/irq-digicolor.c                    |  4 ++++
 drivers/irqchip/irq-dw-apb-ictl.c                  | 11 ++++++---
 drivers/irqchip/irq-loongson-htpic.c               |  6 ++---
 drivers/irqchip/irq-loongson-htvec.c               | 10 +++++++--
 drivers/irqchip/irq-loongson-pch-msi.c             |  7 +-----
 drivers/irqchip/irq-loongson-pch-pic.c             | 15 ++++++++-----
 drivers/irqchip/irq-ls1x.c                         |  4 +++-
 drivers/irqchip/irq-mscc-ocelot.c                  |  6 +++--
 drivers/irqchip/irq-nvic.c                         |  2 ++
 drivers/irqchip/irq-omap-intc.c                    |  4 +++-
 drivers/irqchip/irq-riscv-intc.c                   |  1 +
 drivers/irqchip/irq-s3c24xx.c                      | 20 ++++++++++++-----
 drivers/irqchip/irq-xilinx-intc.c                  |  1 +
 20 files changed, 116 insertions(+), 46 deletions(-)

-- 
2.1.0


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

end of thread, other threads:[~2020-06-28  3:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23 15:55 [PATCH 1/7] irqchip: Fix potential resource leaks Markus Elfring
2020-06-24  1:44 ` Tiezhu Yang
2020-06-24  8:42   ` [1/7] " Markus Elfring
2020-06-24  9:16     ` Tiezhu Yang
2020-06-24  9:23       ` Markus Elfring
2020-06-24  9:56         ` Tiezhu Yang
2020-06-24 10:06           ` Markus Elfring
2020-06-24 11:30             ` Tiezhu Yang
2020-06-24 12:08               ` Markus Elfring
2020-06-28  3:27                 ` Tiezhu Yang
  -- strict thread matches above, loose matches on Subject: below --
2020-06-23  8:51 [PATCH 0/7] Fix potential resource leaks and do some code cleanups about irqchip Tiezhu Yang
2020-06-23  8:51 ` [PATCH 1/7] irqchip: Fix potential resource leaks Tiezhu Yang
2020-06-24  9:15   ` Krzysztof Kozlowski
2020-06-24  9:24     ` Tiezhu Yang

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