linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/14] irqchip: Fix potential resource leaks
@ 2020-07-06  1:19 Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 01/14] irqchip/ath79-misc: " Tiezhu Yang
                   ` (14 more replies)
  0 siblings, 15 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

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.

v2:
  - Split the first patch into a new patch series which
    includes small patches and add "Fixes" tag
  - Use "goto" label to handle error path in some patches

v3:
  - Add missed variable "ret" in the patch #5 and #13

v4:
  - Modify the commit message of each patch suggested by Markus Elfring
  - Make "irq_domain_remove(root_domain)" under CONFIG_SMP in patch #3
  - Add a return statement before goto label in patch #4

v5:
  - Modify the commit messages and do some code cleanups

Tiezhu Yang (14):
  irqchip/ath79-misc: Fix potential resource leaks
  irqchip/csky-apb-intc: Fix potential resource leaks
  irqchip/csky-mpintc: Fix potential resource leaks
  irqchip/davinci-aintc: Fix potential resource leaks
  irqchip/davinci-cp-intc: Fix potential resource leaks
  irqchip/digicolor: Fix potential resource leaks
  irqchip/dw-apb-ictl: Fix potential resource leaks
  irqchip/ls1x: Fix potential resource leaks
  irqchip/mscc-ocelot: Fix potential resource leaks
  irqchip/nvic: Fix potential resource leaks
  irqchip/omap-intc: Fix potential resource leak
  irqchip/riscv-intc: Fix potential resource leak
  irqchip/s3c24xx: Fix potential resource leaks
  irqchip/xilinx-intc: Fix potential resource leak

 drivers/irqchip/irq-ath79-misc.c      | 14 +++++++++++---
 drivers/irqchip/irq-csky-apb-intc.c   | 11 +++++++++--
 drivers/irqchip/irq-csky-mpintc.c     | 31 ++++++++++++++++++++++---------
 drivers/irqchip/irq-davinci-aintc.c   | 18 ++++++++++++++----
 drivers/irqchip/irq-davinci-cp-intc.c | 18 +++++++++++++++---
 drivers/irqchip/irq-digicolor.c       | 14 +++++++++++---
 drivers/irqchip/irq-dw-apb-ictl.c     | 11 ++++++++---
 drivers/irqchip/irq-ls1x.c            |  4 +++-
 drivers/irqchip/irq-mscc-ocelot.c     |  6 ++++--
 drivers/irqchip/irq-nvic.c            | 12 +++++++++---
 drivers/irqchip/irq-omap-intc.c       |  4 +++-
 drivers/irqchip/irq-riscv-intc.c      |  1 +
 drivers/irqchip/irq-s3c24xx.c         | 23 +++++++++++++++++------
 drivers/irqchip/irq-xilinx-intc.c     | 11 ++++++-----
 14 files changed, 133 insertions(+), 45 deletions(-)

-- 
2.1.0


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

* [PATCH v5 01/14] irqchip/ath79-misc: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 02/14] irqchip/csky-apb-intc: " Tiezhu Yang
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function ath79_misc_intc_of_init(), system resources "irq" and
"base" were not released in a few error cases. Thus add jump targets
for the completion of the desired exception handling.

Fixes: 07ba4b061a79 ("irqchip/ath79-misc: Move the MISC driver from arch/mips/ath79/")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-ath79-misc.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-ath79-misc.c b/drivers/irqchip/irq-ath79-misc.c
index 3d641bb..53e0c50 100644
--- a/drivers/irqchip/irq-ath79-misc.c
+++ b/drivers/irqchip/irq-ath79-misc.c
@@ -133,7 +133,7 @@ static int __init ath79_misc_intc_of_init(
 {
 	struct irq_domain *domain;
 	void __iomem *base;
-	int irq;
+	int irq, ret;
 
 	irq = irq_of_parse_and_map(node, 0);
 	if (!irq) {
@@ -144,18 +144,26 @@ static int __init ath79_misc_intc_of_init(
 	base = of_iomap(node, 0);
 	if (!base) {
 		pr_err("Failed to get MISC IRQ registers\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_irq_dispose;
 	}
 
 	domain = irq_domain_add_linear(node, ATH79_MISC_IRQ_COUNT,
 				&misc_irq_domain_ops, base);
 	if (!domain) {
 		pr_err("Failed to add MISC irqdomain\n");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err_iounmap;
 	}
 
 	ath79_misc_intc_domain_init(domain, irq);
 	return 0;
+
+err_iounmap:
+	iounmap(base);
+err_irq_dispose:
+	irq_dispose_mapping(irq);
+	return ret;
 }
 
 static int __init ar7100_misc_intc_of_init(
-- 
2.1.0


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

* [PATCH v5 02/14] irqchip/csky-apb-intc: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 01/14] irqchip/ath79-misc: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 03/14] irqchip/csky-mpintc: " Tiezhu Yang
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function ck_intc_init_comm(), system resources "reg_base" and
"root_domain" were not released in two error cases. Thus add jump
targets for the completion of the desired exception handling.

Fixes: edff1b4835b7 ("irqchip: add C-SKY APB bus interrupt controller")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-csky-apb-intc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-csky-apb-intc.c b/drivers/irqchip/irq-csky-apb-intc.c
index 5a2ec43..66aeb84 100644
--- a/drivers/irqchip/irq-csky-apb-intc.c
+++ b/drivers/irqchip/irq-csky-apb-intc.c
@@ -118,7 +118,8 @@ ck_intc_init_comm(struct device_node *node, struct device_node *parent)
 					    &irq_generic_chip_ops, NULL);
 	if (!root_domain) {
 		pr_err("C-SKY Intc irq_domain_add failed.\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_iounmap;
 	}
 
 	ret = irq_alloc_domain_generic_chips(root_domain, 32, 1,
@@ -126,10 +127,16 @@ ck_intc_init_comm(struct device_node *node, struct device_node *parent)
 			IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN, 0, 0);
 	if (ret) {
 		pr_err("C-SKY Intc irq_alloc_gc failed.\n");
-		return -ENOMEM;
+		goto err_domain_remove;
 	}
 
 	return 0;
+
+err_domain_remove:
+	irq_domain_remove(root_domain);
+err_iounmap:
+	iounmap(reg_base);
+	return ret;
 }
 
 static inline bool handle_irq_perbit(struct pt_regs *regs, u32 hwirq,
-- 
2.1.0


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

* [PATCH v5 03/14] irqchip/csky-mpintc: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 01/14] irqchip/ath79-misc: " Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 02/14] irqchip/csky-apb-intc: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  6:14   ` Markus Elfring
  2020-07-06  1:19 ` [PATCH v5 04/14] irqchip/davinci-aintc: " Tiezhu Yang
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function csky_mpintc_init(), system resources "__trigger",
"INTCG_base" and "root_domain" were not released in a few error
cases. Thus add jump targets for the completion of the desired
exception handling. By the way, do some coding-style cleanups
suggested by Markus.

Fixes: d8a5f5f79122 ("irqchip: add C-SKY SMP interrupt controller")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-csky-mpintc.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/drivers/irqchip/irq-csky-mpintc.c b/drivers/irqchip/irq-csky-mpintc.c
index a1534ed..df41735 100644
--- a/drivers/irqchip/irq-csky-mpintc.c
+++ b/drivers/irqchip/irq-csky-mpintc.c
@@ -241,14 +241,16 @@ csky_mpintc_init(struct device_node *node, struct device_node *parent)
 		nr_irq = INTC_IRQS;
 
 	__trigger  = kcalloc(nr_irq, sizeof(unsigned long), GFP_KERNEL);
-	if (__trigger == NULL)
+	if (!__trigger)
 		return -ENXIO;
 
-	if (INTCG_base == NULL) {
+	if (!INTCG_base) {
 		INTCG_base = ioremap(mfcr("cr<31, 14>"),
-				     INTCL_SIZE*nr_cpu_ids + INTCG_SIZE);
-		if (INTCG_base == NULL)
-			return -EIO;
+				     INTCL_SIZE * nr_cpu_ids + INTCG_SIZE);
+		if (!INTCG_base) {
+			ret = -EIO;
+			goto err_free;
+		}
 
 		INTCL_base = INTCG_base + INTCG_SIZE;
 
@@ -257,8 +259,10 @@ csky_mpintc_init(struct device_node *node, struct device_node *parent)
 
 	root_domain = irq_domain_add_linear(node, nr_irq, &csky_irqdomain_ops,
 					    NULL);
-	if (!root_domain)
-		return -ENXIO;
+	if (!root_domain) {
+		ret = -ENXIO;
+		goto err_iounmap;
+	}
 
 	/* for every cpu */
 	for_each_present_cpu(cpu) {
@@ -270,12 +274,21 @@ csky_mpintc_init(struct device_node *node, struct device_node *parent)
 
 #ifdef CONFIG_SMP
 	ipi_irq = irq_create_mapping(root_domain, IPI_IRQ);
-	if (!ipi_irq)
-		return -EIO;
+	if (!ipi_irq) {
+		irq_domain_remove(root_domain);
+		ret = -EIO;
+		goto err_iounmap;
+	}
 
 	set_send_ipi(&csky_mpintc_send_ipi, ipi_irq);
 #endif
 
 	return 0;
+
+err_iounmap:
+	iounmap(INTCG_base);
+err_free:
+	kfree(__trigger);
+	return ret;
 }
 IRQCHIP_DECLARE(csky_mpintc, "csky,mpintc", csky_mpintc_init);
-- 
2.1.0


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

* [PATCH v5 04/14] irqchip/davinci-aintc: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (2 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 03/14] irqchip/csky-mpintc: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 05/14] irqchip/davinci-cp-intc: " Tiezhu Yang
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function davinci_aintc_init(), system resources "config->reg.start",
"davinci_aintc_base", "irq_base" and "davinci_aintc_irq_domain" were not
released in a few error cases. Thus add jump targets for the completion of
the desired exception handling.

Fixes: 0145beed9d26 ("irqchip: davinci-aintc: move the driver to drivers/irqchip")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-davinci-aintc.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-davinci-aintc.c b/drivers/irqchip/irq-davinci-aintc.c
index 810ccc4..2a96dc9 100644
--- a/drivers/irqchip/irq-davinci-aintc.c
+++ b/drivers/irqchip/irq-davinci-aintc.c
@@ -96,7 +96,7 @@ void __init davinci_aintc_init(const struct davinci_aintc_config *config)
 				     resource_size(&config->reg));
 	if (!davinci_aintc_base) {
 		pr_err("%s: unable to ioremap register range\n", __func__);
-		return;
+		goto err_release;
 	}
 
 	/* Clear all interrupt requests */
@@ -133,7 +133,7 @@ void __init davinci_aintc_init(const struct davinci_aintc_config *config)
 	if (irq_base < 0) {
 		pr_err("%s: unable to allocate interrupt descriptors: %d\n",
 		       __func__, irq_base);
-		return;
+		goto err_iounmap;
 	}
 
 	davinci_aintc_irq_domain = irq_domain_add_legacy(NULL,
@@ -141,7 +141,7 @@ void __init davinci_aintc_init(const struct davinci_aintc_config *config)
 						&irq_domain_simple_ops, NULL);
 	if (!davinci_aintc_irq_domain) {
 		pr_err("%s: unable to create interrupt domain\n", __func__);
-		return;
+		goto err_free_descs;
 	}
 
 	ret = irq_alloc_domain_generic_chips(davinci_aintc_irq_domain, 32, 1,
@@ -150,7 +150,7 @@ void __init davinci_aintc_init(const struct davinci_aintc_config *config)
 	if (ret) {
 		pr_err("%s: unable to allocate generic irq chips for domain\n",
 		       __func__);
-		return;
+		goto err_domain_remove;
 	}
 
 	for (irq_off = 0, reg_off = 0;
@@ -160,4 +160,14 @@ void __init davinci_aintc_init(const struct davinci_aintc_config *config)
 				       irq_base + irq_off, 32);
 
 	set_handle_irq(davinci_aintc_handle_irq);
+	return;
+
+err_domain_remove:
+	irq_domain_remove(davinci_aintc_irq_domain);
+err_free_descs:
+	irq_free_descs(irq_base, config->num_irqs);
+err_iounmap:
+	iounmap(davinci_aintc_base);
+err_release:
+	release_mem_region(config->reg.start, resource_size(&config->reg));
 }
-- 
2.1.0


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

* [PATCH v5 05/14] irqchip/davinci-cp-intc: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (3 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 04/14] irqchip/davinci-aintc: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 06/14] irqchip/digicolor: " Tiezhu Yang
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function davinci_cp_intc_do_init(), system resources
"config->reg.start", "davinci_cp_intc_base" and "irq_base"
were not released in a few error cases. Thus add jump targets
for the completion of the desired exception handling.

Fixes: 0fc3d74cf946 ("irqchip: davinci-cp-intc: move the driver to drivers/irqchip")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-davinci-cp-intc.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-davinci-cp-intc.c b/drivers/irqchip/irq-davinci-cp-intc.c
index 276da277..2c2e115 100644
--- a/drivers/irqchip/irq-davinci-cp-intc.c
+++ b/drivers/irqchip/irq-davinci-cp-intc.c
@@ -162,6 +162,7 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
 	unsigned int num_regs = BITS_TO_LONGS(config->num_irqs);
 	int offset, irq_base;
 	void __iomem *req;
+	int ret;
 
 	req = request_mem_region(config->reg.start,
 				 resource_size(&config->reg),
@@ -175,7 +176,8 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
 				       resource_size(&config->reg));
 	if (!davinci_cp_intc_base) {
 		pr_err("%s: unable to ioremap register range\n", __func__);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err_release;
 	}
 
 	davinci_cp_intc_write(0, DAVINCI_CP_INTC_GLOBAL_ENABLE);
@@ -210,7 +212,8 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
 	if (irq_base < 0) {
 		pr_err("%s: unable to allocate interrupt descriptors: %d\n",
 		       __func__, irq_base);
-		return irq_base;
+		ret = irq_base;
+		goto err_iounmap;
 	}
 
 	davinci_cp_intc_irq_domain = irq_domain_add_legacy(
@@ -219,7 +222,8 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
 
 	if (!davinci_cp_intc_irq_domain) {
 		pr_err("%s: unable to create an interrupt domain\n", __func__);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err_free_descs;
 	}
 
 	set_handle_irq(davinci_cp_intc_handle_irq);
@@ -228,6 +232,14 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
 	davinci_cp_intc_write(1, DAVINCI_CP_INTC_GLOBAL_ENABLE);
 
 	return 0;
+
+err_free_descs:
+	irq_free_descs(irq_base, config->num_irqs);
+err_iounmap:
+	iounmap(davinci_cp_intc_base);
+err_release:
+	release_mem_region(config->reg.start, resource_size(&config->reg));
+	return ret;
 }
 
 int __init davinci_cp_intc_init(const struct davinci_cp_intc_config *config)
-- 
2.1.0


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

* [PATCH v5 06/14] irqchip/digicolor: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (4 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 05/14] irqchip/davinci-cp-intc: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 07/14] irqchip/dw-apb-ictl: " Tiezhu Yang
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function digicolor_of_init(), system resources "reg_base" and
"digicolor_irq_domain" were not released in a few error cases. Thus
add jump targets for the completion of the desired exception handling.

Fixes: 8041dfbd31cf ("irqchip: Conexant CX92755 interrupts controller driver")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-digicolor.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
index fc38d2d..18c6e77 100644
--- a/drivers/irqchip/irq-digicolor.c
+++ b/drivers/irqchip/irq-digicolor.c
@@ -89,7 +89,8 @@ static int __init digicolor_of_init(struct device_node *node,
 	ucregs = syscon_regmap_lookup_by_phandle(node, "syscon");
 	if (IS_ERR(ucregs)) {
 		pr_err("%pOF: unable to map UC registers\n", node);
-		return PTR_ERR(ucregs);
+		ret = PTR_ERR(ucregs);
+		goto err_iounmap;
 	}
 	/* channel 1, regular IRQs */
 	regmap_write(ucregs, UC_IRQ_CONTROL, 1);
@@ -98,7 +99,8 @@ static int __init digicolor_of_init(struct device_node *node,
 		irq_domain_add_linear(node, 64, &irq_generic_chip_ops, NULL);
 	if (!digicolor_irq_domain) {
 		pr_err("%pOF: unable to create IRQ domain\n", node);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_iounmap;
 	}
 
 	ret = irq_alloc_domain_generic_chips(digicolor_irq_domain, 32, 1,
@@ -106,7 +108,7 @@ static int __init digicolor_of_init(struct device_node *node,
 					     clr, 0, 0);
 	if (ret) {
 		pr_err("%pOF: unable to allocate IRQ gc\n", node);
-		return ret;
+		goto err_domain_remove;
 	}
 
 	digicolor_set_gc(reg_base, 0, IC_INT0ENABLE_LO, IC_FLAG_CLEAR_LO);
@@ -115,5 +117,11 @@ static int __init digicolor_of_init(struct device_node *node,
 	set_handle_irq(digicolor_handle_irq);
 
 	return 0;
+
+err_domain_remove:
+	irq_domain_remove(digicolor_irq_domain);
+err_iounmap:
+	iounmap(reg_base);
+	return ret;
 }
 IRQCHIP_DECLARE(conexant_digicolor_ic, "cnxt,cx92755-ic", digicolor_of_init);
-- 
2.1.0


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

* [PATCH v5 07/14] irqchip/dw-apb-ictl: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (5 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 06/14] irqchip/digicolor: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 08/14] irqchip/ls1x: " Tiezhu Yang
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function dw_apb_ictl_init(), system resources "irq" and "domain"
were not released in a few error cases. Thus add jump targets for the
completion of the desired exception handling.

Fixes: 350d71b94fc9 ("irqchip: add DesignWare APB ICTL interrupt controller")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-dw-apb-ictl.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-dw-apb-ictl.c b/drivers/irqchip/irq-dw-apb-ictl.c
index e4550e9..bc9b750 100644
--- a/drivers/irqchip/irq-dw-apb-ictl.c
+++ b/drivers/irqchip/irq-dw-apb-ictl.c
@@ -86,12 +86,13 @@ static int __init dw_apb_ictl_init(struct device_node *np,
 	ret = of_address_to_resource(np, 0, &r);
 	if (ret) {
 		pr_err("%pOF: unable to get resource\n", np);
-		return ret;
+		goto err_irq_dispose;
 	}
 
 	if (!request_mem_region(r.start, resource_size(&r), np->full_name)) {
 		pr_err("%pOF: unable to request mem region\n", np);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_irq_dispose;
 	}
 
 	iobase = ioremap(r.start, resource_size(&r));
@@ -133,7 +134,7 @@ static int __init dw_apb_ictl_init(struct device_node *np,
 					     IRQ_GC_INIT_MASK_CACHE);
 	if (ret) {
 		pr_err("%pOF: unable to alloc irq domain gc\n", np);
-		goto err_unmap;
+		goto err_domain_remove;
 	}
 
 	for (i = 0; i < DIV_ROUND_UP(nrirqs, 32); i++) {
@@ -150,10 +151,14 @@ static int __init dw_apb_ictl_init(struct device_node *np,
 
 	return 0;
 
+err_domain_remove:
+	irq_domain_remove(domain);
 err_unmap:
 	iounmap(iobase);
 err_release:
 	release_mem_region(r.start, resource_size(&r));
+err_irq_dispose:
+	irq_dispose_mapping(irq);
 	return ret;
 }
 IRQCHIP_DECLARE(dw_apb_ictl,
-- 
2.1.0


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

* [PATCH v5 08/14] irqchip/ls1x: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (6 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 07/14] irqchip/dw-apb-ictl: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 09/14] irqchip/mscc-ocelot: " Tiezhu Yang
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function ls1x_intc_of_init(), system resource "parent_irq"
was not released in two error cases. Thus add a jump target for
the completion of the desired exception handling.

Fixes: 9e543e22e204 ("irqchip: Add driver for Loongson-1 interrupt controller")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-ls1x.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-ls1x.c b/drivers/irqchip/irq-ls1x.c
index 353111a..409001b 100644
--- a/drivers/irqchip/irq-ls1x.c
+++ b/drivers/irqchip/irq-ls1x.c
@@ -131,7 +131,7 @@ static int __init ls1x_intc_of_init(struct device_node *node,
 	if (!priv->domain) {
 		pr_err("ls1x-irq: cannot add IRQ domain\n");
 		err = -ENOMEM;
-		goto out_iounmap;
+		goto out_dispose_irq;
 	}
 
 	err = irq_alloc_domain_generic_chips(priv->domain, 32, 2,
@@ -182,6 +182,8 @@ static int __init ls1x_intc_of_init(struct device_node *node,
 
 out_free_domain:
 	irq_domain_remove(priv->domain);
+out_dispose_irq:
+	irq_dispose_mapping(parent_irq);
 out_iounmap:
 	iounmap(priv->intc_base);
 out_free_priv:
-- 
2.1.0


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

* [PATCH v5 09/14] irqchip/mscc-ocelot: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (7 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 08/14] irqchip/ls1x: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 10/14] irqchip/nvic: " Tiezhu Yang
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function ocelot_irq_init(), system resource "parent_irq"
was not released in a few error cases. Thus add a jump target
for the completion of the desired exception handling.

Fixes: 19d99164480a ("irqchip: Add a driver for the Microsemi Ocelot controller")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-mscc-ocelot.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c
index 88143c0..e676ae2 100644
--- a/drivers/irqchip/irq-mscc-ocelot.c
+++ b/drivers/irqchip/irq-mscc-ocelot.c
@@ -73,7 +73,8 @@ static int __init ocelot_irq_init(struct device_node *node,
 				       &irq_generic_chip_ops, NULL);
 	if (!domain) {
 		pr_err("%pOFn: unable to add irq domain\n", node);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_irq_dispose;
 	}
 
 	ret = irq_alloc_domain_generic_chips(domain, OCELOT_NR_IRQ, 1,
@@ -109,9 +110,10 @@ static int __init ocelot_irq_init(struct device_node *node,
 
 err_gc_free:
 	irq_free_generic_chip(gc);
-
 err_domain_remove:
 	irq_domain_remove(domain);
+err_irq_dispose:
+	irq_dispose_mapping(parent_irq);
 
 	return ret;
 }
-- 
2.1.0


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

* [PATCH v5 10/14] irqchip/nvic: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (8 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 09/14] irqchip/mscc-ocelot: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 11/14] irqchip/omap-intc: Fix potential resource leak Tiezhu Yang
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function nvic_of_init(), system resource "nvic_base" and
"nvic_irq_domain" were not released in two error cases. Thus add
jump targets for the completion of the desired exception handling.

Fixes: 292ec080491d ("irqchip: Add support for ARMv7-M NVIC")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-nvic.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-nvic.c b/drivers/irqchip/irq-nvic.c
index f747e22..cd17f5d 100644
--- a/drivers/irqchip/irq-nvic.c
+++ b/drivers/irqchip/irq-nvic.c
@@ -94,7 +94,8 @@ static int __init nvic_of_init(struct device_node *node,
 
 	if (!nvic_irq_domain) {
 		pr_warn("Failed to allocate irq domain\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_iounmap;
 	}
 
 	ret = irq_alloc_domain_generic_chips(nvic_irq_domain, 32, 1,
@@ -102,8 +103,7 @@ static int __init nvic_of_init(struct device_node *node,
 					     clr, 0, IRQ_GC_INIT_MASK_CACHE);
 	if (ret) {
 		pr_warn("Failed to allocate irq chips\n");
-		irq_domain_remove(nvic_irq_domain);
-		return ret;
+		goto err_domain_remove;
 	}
 
 	for (i = 0; i < numbanks; ++i) {
@@ -129,5 +129,11 @@ static int __init nvic_of_init(struct device_node *node,
 		writel_relaxed(0, nvic_base + NVIC_IPR + i);
 
 	return 0;
+
+err_domain_remove:
+	irq_domain_remove(nvic_irq_domain);
+err_iounmap:
+	iounmap(nvic_base);
+	return ret;
 }
 IRQCHIP_DECLARE(armv7m_nvic, "arm,armv7m-nvic", nvic_of_init);
-- 
2.1.0


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

* [PATCH v5 11/14] irqchip/omap-intc: Fix potential resource leak
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (9 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 10/14] irqchip/nvic: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 12/14] irqchip/riscv-intc: " Tiezhu Yang
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function omap_init_irq_of(), system resource "omap_irq_base"
was not released in an error case. Thus add a call of the function
"iounmap" in the if branch.

Fixes: 8598066cddd1 ("arm: omap: irq: move irq.c to drivers/irqchip/")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-omap-intc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
index d360a6e..e711530 100644
--- a/drivers/irqchip/irq-omap-intc.c
+++ b/drivers/irqchip/irq-omap-intc.c
@@ -254,8 +254,10 @@ static int __init omap_init_irq_of(struct device_node *node)
 	omap_irq_soft_reset();
 
 	ret = omap_alloc_gc_of(domain, omap_irq_base);
-	if (ret < 0)
+	if (ret < 0) {
 		irq_domain_remove(domain);
+		iounmap(omap_irq_base);
+	}
 
 	return ret;
 }
-- 
2.1.0


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

* [PATCH v5 12/14] irqchip/riscv-intc: Fix potential resource leak
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (10 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 11/14] irqchip/omap-intc: Fix potential resource leak Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 13/14] irqchip/s3c24xx: Fix potential resource leaks Tiezhu Yang
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function riscv_intc_init(), system resource "intc_domain"
was not released in an error case. Thus add a call of the function
"irq_domain_remove" in the if branch.

Fixes: 6b7ce8927b5a ("irqchip: RISC-V per-HART local interrupt controller driver")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Reviewed-by: Anup Patel <anup@brainfault.org>
---
 drivers/irqchip/irq-riscv-intc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c
index a6f97fa..8d6286c 100644
--- a/drivers/irqchip/irq-riscv-intc.c
+++ b/drivers/irqchip/irq-riscv-intc.c
@@ -122,6 +122,7 @@ static int __init riscv_intc_init(struct device_node *node,
 	rc = set_handle_irq(&riscv_intc_irq);
 	if (rc) {
 		pr_err("failed to set irq handler\n");
+		irq_domain_remove(intc_domain);
 		return rc;
 	}
 
-- 
2.1.0


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

* [PATCH v5 13/14] irqchip/s3c24xx: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (11 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 12/14] irqchip/riscv-intc: " Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  1:19 ` [PATCH v5 14/14] irqchip/xilinx-intc: Fix potential resource leak Tiezhu Yang
  2020-07-06  7:30 ` [PATCH v5 00/14] irqchip: Fix potential resource leaks Marc Zyngier
  14 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function s3c_init_intc_of(), system resource "reg_base", "domain"
and "intc" were not released in a few error cases. Thus add jump targets
for the completion of the desired exception handling.

Fixes: f0774d41da0e ("irqchip: s3c24xx: add devicetree support")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-s3c24xx.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/irqchip/irq-s3c24xx.c b/drivers/irqchip/irq-s3c24xx.c
index d2031fe..cf48e4b 100644
--- a/drivers/irqchip/irq-s3c24xx.c
+++ b/drivers/irqchip/irq-s3c24xx.c
@@ -1227,7 +1227,7 @@ static int __init s3c_init_intc_of(struct device_node *np,
 	struct s3c24xx_irq_of_ctrl *ctrl;
 	struct irq_domain *domain;
 	void __iomem *reg_base;
-	int i;
+	int i, ret;
 
 	reg_base = of_iomap(np, 0);
 	if (!reg_base) {
@@ -1239,7 +1239,8 @@ static int __init s3c_init_intc_of(struct device_node *np,
 						     &s3c24xx_irq_ops_of, NULL);
 	if (!domain) {
 		pr_err("irq: could not create irq-domain\n");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err_iounmap;
 	}
 
 	for (i = 0; i < num_ctrl; i++) {
@@ -1248,15 +1249,17 @@ static int __init s3c_init_intc_of(struct device_node *np,
 		pr_debug("irq: found controller %s\n", ctrl->name);
 
 		intc = kzalloc(sizeof(struct s3c_irq_intc), GFP_KERNEL);
-		if (!intc)
-			return -ENOMEM;
+		if (!intc) {
+			ret = -ENOMEM;
+			goto err_domain_remove;
+		}
 
 		intc->domain = domain;
 		intc->irqs = kcalloc(32, sizeof(struct s3c_irq_data),
 				     GFP_KERNEL);
 		if (!intc->irqs) {
-			kfree(intc);
-			return -ENOMEM;
+			ret = -ENOMEM;
+			goto err_free;
 		}
 
 		if (ctrl->parent) {
@@ -1285,6 +1288,14 @@ static int __init s3c_init_intc_of(struct device_node *np,
 	set_handle_irq(s3c24xx_handle_irq);
 
 	return 0;
+
+err_free:
+	kfree(intc);
+err_domain_remove:
+	irq_domain_remove(domain);
+err_iounmap:
+	iounmap(reg_base);
+	return ret;
 }
 
 static struct s3c24xx_irq_of_ctrl s3c2410_ctrl[] = {
-- 
2.1.0


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

* [PATCH v5 14/14] irqchip/xilinx-intc: Fix potential resource leak
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (12 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 13/14] irqchip/s3c24xx: Fix potential resource leaks Tiezhu Yang
@ 2020-07-06  1:19 ` Tiezhu Yang
  2020-07-06  7:30   ` Markus Elfring
  2020-07-06  7:30 ` [PATCH v5 00/14] irqchip: Fix potential resource leaks Marc Zyngier
  14 siblings, 1 reply; 21+ messages in thread
From: Tiezhu Yang @ 2020-07-06  1:19 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Markus Elfring

In the function xilinx_intc_of_init(), system resource "irqc->root_domain"
was not released in an error case. Thus add a jump target to call the
function "irq_domain_remove" for the completion of the desired exception
handling.

Fixes: 9689c99e4950 ("irqchip/xilinx: Add support for parent intc")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-xilinx-intc.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c
index 1d3d273..41d9412 100644
--- a/drivers/irqchip/irq-xilinx-intc.c
+++ b/drivers/irqchip/irq-xilinx-intc.c
@@ -192,7 +192,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
 	ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &irqc->nr_irq);
 	if (ret < 0) {
 		pr_err("irq-xilinx: unable to read xlnx,num-intr-inputs\n");
-		goto error;
+		goto err_iounmap;
 	}
 
 	ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &irqc->intr_mask);
@@ -229,7 +229,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
 	if (!irqc->root_domain) {
 		pr_err("irq-xilinx: Unable to create IRQ domain\n");
 		ret = -EINVAL;
-		goto error;
+		goto err_iounmap;
 	}
 
 	if (parent) {
@@ -241,7 +241,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
 		} else {
 			pr_err("irq-xilinx: interrupts property not in DT\n");
 			ret = -EINVAL;
-			goto error;
+			goto err_domain_remove;
 		}
 	} else {
 		primary_intc = irqc;
@@ -250,11 +250,12 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
 
 	return 0;
 
-error:
+err_domain_remove:
+	irq_domain_remove(irqc->root_domain);
+err_iounmap:
 	iounmap(irqc->base);
 	kfree(irqc);
 	return ret;
-
 }
 
 IRQCHIP_DECLARE(xilinx_intc_xps, "xlnx,xps-intc-1.00.a", xilinx_intc_of_init);
-- 
2.1.0


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

* Re: [PATCH v5 03/14] irqchip/csky-mpintc: Fix potential resource leaks
  2020-07-06  1:19 ` [PATCH v5 03/14] irqchip/csky-mpintc: " Tiezhu Yang
@ 2020-07-06  6:14   ` Markus Elfring
  0 siblings, 0 replies; 21+ messages in thread
From: Markus Elfring @ 2020-07-06  6:14 UTC (permalink / raw)
  To: Tiezhu Yang, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	Guo Ren, linux-csky
  Cc: linux-kernel, kernel-janitors, Denis Efremov, Gustavo A. R. Silva

> … Thus add jump targets for the completion of the desired
> exception handling. By the way, do some coding-style cleanups
> suggested by Markus.

I propose to split these changes.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=dcb7fd82c75ee2d6e6f9d8cc71c52519ed52e258#n138

Would you like to support easier back-porting of a fix
besides another bit of possible source code beautification?


…
+++ b/drivers/irqchip/irq-csky-mpintc.c
@@ -241,14 +241,16 @@ csky_mpintc_init(struct device_node *node, struct device_node *parent)
…
 		INTCG_base = ioremap(mfcr("cr<31, 14>"),
-				     INTCL_SIZE*nr_cpu_ids + INTCG_SIZE);
…
+				     INTCL_SIZE * nr_cpu_ids + INTCG_SIZE);

Can any macro (or function) be helpful for such a size computation?

Regards,
Markus

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

* Re: [PATCH v5 14/14] irqchip/xilinx-intc: Fix potential resource leak
  2020-07-06  1:19 ` [PATCH v5 14/14] irqchip/xilinx-intc: Fix potential resource leak Tiezhu Yang
@ 2020-07-06  7:30   ` Markus Elfring
  0 siblings, 0 replies; 21+ messages in thread
From: Markus Elfring @ 2020-07-06  7:30 UTC (permalink / raw)
  To: Tiezhu Yang, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	Michal Simek, linux-arm-kernel
  Cc: linux-kernel, kernel-janitors

> In the function xilinx_intc_of_init(), system resource "irqc->root_domain"
> was not released in an error case. Thus add a jump target to call the
> function "irq_domain_remove" for the completion of the desired exception
> handling.

Do the corresponding diff hunks express also a renaming of the label “error”?

Is there a need to split such an adjustment?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=dcb7fd82c75ee2d6e6f9d8cc71c52519ed52e258#n138

Regards,
Markus

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

* Re: [PATCH v5 00/14] irqchip: Fix potential resource leaks
  2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
                   ` (13 preceding siblings ...)
  2020-07-06  1:19 ` [PATCH v5 14/14] irqchip/xilinx-intc: Fix potential resource leak Tiezhu Yang
@ 2020-07-06  7:30 ` Marc Zyngier
  2020-07-06  7:43   ` Markus Elfring
  2020-09-02  3:59   ` Tiezhu Yang
  14 siblings, 2 replies; 21+ messages in thread
From: Marc Zyngier @ 2020-07-06  7:30 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: Thomas Gleixner, Jason Cooper, linux-kernel, Markus Elfring

On 2020-07-06 02:19, Tiezhu Yang wrote:
> 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.
> 
> v2:
>   - Split the first patch into a new patch series which
>     includes small patches and add "Fixes" tag
>   - Use "goto" label to handle error path in some patches
> 
> v3:
>   - Add missed variable "ret" in the patch #5 and #13
> 
> v4:
>   - Modify the commit message of each patch suggested by Markus Elfring
>   - Make "irq_domain_remove(root_domain)" under CONFIG_SMP in patch #3
>   - Add a return statement before goto label in patch #4
> 
> v5:
>   - Modify the commit messages and do some code cleanups

Please stop replying to Markus Elfring, and give people who actually
care a chance to review this code. Elfring will keep asking you to make
absolutely pointless changes until you are blue in the face

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [PATCH v5 00/14] irqchip: Fix potential resource leaks
  2020-07-06  7:30 ` [PATCH v5 00/14] irqchip: Fix potential resource leaks Marc Zyngier
@ 2020-07-06  7:43   ` Markus Elfring
  2020-09-02  3:59   ` Tiezhu Yang
  1 sibling, 0 replies; 21+ messages in thread
From: Markus Elfring @ 2020-07-06  7:43 UTC (permalink / raw)
  To: Marc Zyngier, Tiezhu Yang
  Cc: Thomas Gleixner, Jason Cooper, linux-kernel, kernel-janitors

>> v5:
>>   - Modify the commit messages and do some code cleanups
>
> Please stop replying to Markus Elfring, and give people who actually
> care a chance to review this code.

You got the usual chances for the desired patch review.


>                                    Elfring will keep asking you to make
> absolutely pointless changes until you are blue in the face

Can the circumstances evolve in ways under which you would admit
the relevance of (my) suggestions for possible software improvements?

Regards,
Markus

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

* Re: [PATCH v5 00/14] irqchip: Fix potential resource leaks
  2020-07-06  7:30 ` [PATCH v5 00/14] irqchip: Fix potential resource leaks Marc Zyngier
  2020-07-06  7:43   ` Markus Elfring
@ 2020-09-02  3:59   ` Tiezhu Yang
  2020-10-12  2:31     ` Tiezhu Yang
  1 sibling, 1 reply; 21+ messages in thread
From: Tiezhu Yang @ 2020-09-02  3:59 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Thomas Gleixner, Jason Cooper, linux-kernel

On 07/06/2020 03:30 PM, Marc Zyngier wrote:
> On 2020-07-06 02:19, Tiezhu Yang wrote:
>> 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.
>>
>> v2:
>>   - Split the first patch into a new patch series which
>>     includes small patches and add "Fixes" tag
>>   - Use "goto" label to handle error path in some patches
>>
>> v3:
>>   - Add missed variable "ret" in the patch #5 and #13
>>
>> v4:
>>   - Modify the commit message of each patch suggested by Markus Elfring
>>   - Make "irq_domain_remove(root_domain)" under CONFIG_SMP in patch #3
>>   - Add a return statement before goto label in patch #4
>>
>> v5:
>>   - Modify the commit messages and do some code cleanups
>
> Please stop replying to Markus Elfring, and give people who actually
> care a chance to review this code. Elfring will keep asking you to make
> absolutely pointless changes until you are blue in the face

Hi Marc,

Any comments?
Could you please apply this patch series?

Thanks,
Tiezhu

>
>
> Thanks,
>
>         M.


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

* Re: [PATCH v5 00/14] irqchip: Fix potential resource leaks
  2020-09-02  3:59   ` Tiezhu Yang
@ 2020-10-12  2:31     ` Tiezhu Yang
  0 siblings, 0 replies; 21+ messages in thread
From: Tiezhu Yang @ 2020-10-12  2:31 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Thomas Gleixner, Jason Cooper, linux-kernel, Alban Bedel,
	Guo Ren, Mark Rutland, Sekhar Nori, Bartosz Golaszewski,
	David Lechner, Baruch Siach, Jisheng Zhang,
	Sebastian Hesselbarth, Jiaxun Yang, Alexandre Belloni,
	Arnd Bergmann, Grant Likely, u.kleine-koenig, Catalin Marinas,
	Tony Lindgren, Felipe Balbi, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Anup Patel, Kukjin Kim, Krzysztof Kozlowski,
	Heiko Stuebner, Rob Herring, Michal Simek,
	Zubair Lutfullah Kakakhel, linux-csky, linux-arm-kernel,
	linux-omap, linux-riscv, linux-samsung-soc

On 09/02/2020 11:59 AM, Tiezhu Yang wrote:
> On 07/06/2020 03:30 PM, Marc Zyngier wrote:
>> On 2020-07-06 02:19, Tiezhu Yang wrote:
>>> 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.
>>>
>>> v2:
>>>   - Split the first patch into a new patch series which
>>>     includes small patches and add "Fixes" tag
>>>   - Use "goto" label to handle error path in some patches
>>>
>>> v3:
>>>   - Add missed variable "ret" in the patch #5 and #13
>>>
>>> v4:
>>>   - Modify the commit message of each patch suggested by Markus Elfring
>>>   - Make "irq_domain_remove(root_domain)" under CONFIG_SMP in patch #3
>>>   - Add a return statement before goto label in patch #4
>>>
>>> v5:
>>>   - Modify the commit messages and do some code cleanups
>>
>> Please stop replying to Markus Elfring, and give people who actually
>> care a chance to review this code. Elfring will keep asking you to make
>> absolutely pointless changes until you are blue in the face
>
> Hi Marc,
>
> Any comments?
> Could you please apply this patch series?

Hi all,

Maybe I should cc the related persons through ./scripts/get_maintainer.pl
to get Acked-by or Reviewed-by.

The cover letter link of this patch series is:
[v5,00/14] irqchip: Fix potential resource leaks
https://lore.kernel.org/patchwork/cover/1268043/

Any comments will be much appreciated.

Thanks,
Tiezhu

>
> Thanks,
> Tiezhu
>
>>
>>
>> Thanks,
>>
>>         M.
>


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

end of thread, other threads:[~2020-10-12  2:33 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06  1:19 [PATCH v5 00/14] irqchip: Fix potential resource leaks Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 01/14] irqchip/ath79-misc: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 02/14] irqchip/csky-apb-intc: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 03/14] irqchip/csky-mpintc: " Tiezhu Yang
2020-07-06  6:14   ` Markus Elfring
2020-07-06  1:19 ` [PATCH v5 04/14] irqchip/davinci-aintc: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 05/14] irqchip/davinci-cp-intc: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 06/14] irqchip/digicolor: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 07/14] irqchip/dw-apb-ictl: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 08/14] irqchip/ls1x: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 09/14] irqchip/mscc-ocelot: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 10/14] irqchip/nvic: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 11/14] irqchip/omap-intc: Fix potential resource leak Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 12/14] irqchip/riscv-intc: " Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 13/14] irqchip/s3c24xx: Fix potential resource leaks Tiezhu Yang
2020-07-06  1:19 ` [PATCH v5 14/14] irqchip/xilinx-intc: Fix potential resource leak Tiezhu Yang
2020-07-06  7:30   ` Markus Elfring
2020-07-06  7:30 ` [PATCH v5 00/14] irqchip: Fix potential resource leaks Marc Zyngier
2020-07-06  7:43   ` Markus Elfring
2020-09-02  3:59   ` Tiezhu Yang
2020-10-12  2:31     ` 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).