Skip to contentSkip to conversation

irqchip/irq-ls1x: Missing error code in ls1x_intc_of_init()

PATCH Superseded Dan Carpenter 4 participants 5 messages Mar 28, 2019 – Apr 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/irq-ls1x: Missing error code in ls1x_intc_of_init()

We forgot to set "err" on this error path.

Fixes 9e543e22e204 ("irqchip: Add driver for Loongson-1 interrupt controller")
---
 drivers/irqchip/irq-ls1x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-ls1x.c +1 -0
index 86b72fbd3b45..353111a10413 100644
@@ -130,6 +130,7 @@ static int __init ls1x_intc_of_init(struct device_node *node,
 					     NULL);
 	if (!priv->domain) {
 		pr_err("ls1x-irq: cannot add IRQ domain\n");
+		err = -ENOMEM;
 		goto out_iounmap;
 	}
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Dan Carpenter

We forgot to set "err" on this error path.

What is "this" error path, please describe

like

"Currently, when irq_domain_add_linear() fails, error code does not get set due to which

it return zero which is wrong.Fix it by setting appropriate error code."

Quoted 2 lines
Fixes 9e543e22e204 ("irqchip: Add driver for Loongson-1 interrupt controller")

Other wise change looks good .

-Mukesh

Quoted 16 lines
---
  drivers/irqchip/irq-ls1x.c | 1 +
  1 file changed, 1 insertion(+)
drivers/irqchip/irq-ls1x.c +1 -0
index 86b72fbd3b45..353111a10413 100644
@@ -130,6 +130,7 @@ static int __init ls1x_intc_of_init(struct device_node *node,
  					     NULL);
  	if (!priv->domain) {
  		pr_err("ls1x-irq: cannot add IRQ domain\n");
+		err = -ENOMEM;
  		goto out_iounmap;
  	}
 
#2 lore raw

PATCH v2 1/1 irqchip/irq-ls1x: Missing error code in ls1x_intc_of_init()

Currently, when irq_domain_add_linear() fails, the error code does not get so it returns zero which is wrong. Fix it by setting appropriate error code.

Fixes 9e543e22e204 ("irqchip: Add driver for Loongson-1 interrupt controller")

---
V2: Improve the commit message

 drivers/irqchip/irq-ls1x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-ls1x.c +1 -0
index 86b72fbd3b45..353111a10413 100644
@@ -130,6 +130,7 @@ static int __init ls1x_intc_of_init(struct device_node *node,
 					     NULL);
 	if (!priv->domain) {
 		pr_err("ls1x-irq: cannot add IRQ domain\n");
+		err = -ENOMEM;
 		goto out_iounmap;
 	}
 
Signature · 1 line
2.17.1
Acked-by on v2 1/1
#3 lore raw

Thanks!

--

Jiaxun Yang

ÔÚ 2019/3/29 14:21, Dan Carpenter дµÀ:

Quoted 25 lines

Currently, when irq_domain_add_linear() fails, the error code does not get so it returns zero which is wrong. Fix it by setting appropriate error code.

Fixes 9e543e22e204 ("irqchip: Add driver for Loongson-1 interrupt controller")

---
V2: Improve the commit message

  drivers/irqchip/irq-ls1x.c | 1 +
  1 file changed, 1 insertion(+)
drivers/irqchip/irq-ls1x.c +1 -0
index 86b72fbd3b45..353111a10413 100644
@@ -130,6 +130,7 @@ static int __init ls1x_intc_of_init(struct device_node *node,
  					     NULL);
  	if (!priv->domain) {
  		pr_err("ls1x-irq: cannot add IRQ domain\n");
+		err = -ENOMEM;
  		goto out_iounmap;
  	}
 
#4 lore raw
In reply to Dan Carpenter
irqchip/irq-ls1x: Missing error code in ls1x_intc_of_init()
Commit-ID:  95c5c618fa4349b2ba13aebeabf71911208dfc5e
Gitweb:     https://git.kernel.org/tip/95c5c618fa4349b2ba13aebeabf71911208dfc5e
Author:     Dan Carpenter <[email protected]>
AuthorDate: Fri, 29 Mar 2019 09:21:37 +0300
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Fri, 5 Apr 2019 14:37:56 +0200

irqchip/irq-ls1x: Missing error code in ls1x_intc_of_init()

Currently, when irq_domain_add_linear() fails, the error code does not get set so it returns zero which is wrong. Fix it by setting the appropriate error code.

Fixes 9e543e22e204 ("irqchip: Add driver for Loongson-1 interrupt controller")
Cc Marc Zyngier <[email protected]>
Cc Jiaxun Yang <[email protected]>
Cc Jason Cooper <[email protected]>
---
 drivers/irqchip/irq-ls1x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-ls1x.c +1 -0
index 86b72fbd3b45..353111a10413 100644
@@ -130,6 +130,7 @@ static int __init ls1x_intc_of_init(struct device_node *node,
 					     NULL);
 	if (!priv->domain) {
 		pr_err("ls1x-irq: cannot add IRQ domain\n");
+		err = -ENOMEM;
 		goto out_iounmap;
 	}