lkml.org 
[lkml]   [2022]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] irqchip/loongson-liointc: Fix an error handling path in liointc_init()
Date
If a of_property_match_string() call fails, we still need to release some
resources.
Add the corresponding goto instead of a direct return.

Fixes: 807e93d0ecbb ("irqchip/loongson-liointc: Add ACPI init support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/irqchip/irq-loongson-liointc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index ff3cb5b05710..2227b702a81d 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -185,8 +185,10 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision,
int index = of_property_match_string(node,
"reg-names", core_reg_names[i]);

- if (index < 0)
- return -EINVAL;
+ if (index < 0) {
+ err = -EINVAL;
+ goto out_iounmap;
+ }

priv->core_isr[i] = of_iomap(node, index);
}
--
2.34.1
\
 
 \ /
  Last update: 2022-05-22 15:44    [W:0.060 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site