Skip to contentSkip to conversation

mips: Vr41xx: add missing iounmap() on error in vr41xx_pciu_init()

PATCH Applied Qinglang Miao 2 participants 2 messages Oct 29, 2020 – Nov 6, 2020 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips: Vr41xx: add missing iounmap() on error in vr41xx_pciu_init()

add missing iounmap() of pciu_base on error when failed to init io_map_base.

---
 arch/mips/pci/pci-vr41xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/mips/pci/pci-vr41xx.c +3 -1
index 1fa4e1014..4f250c55b 100644
@@ -293,8 +293,10 @@ static int __init vr41xx_pciu_init(void)
 		master = setup->master_io;
 		io_map_base = ioremap(master->bus_base_address,
 				      resource_size(res));
-		if (!io_map_base)
+		if (!io_map_base) {
+			iounmap(pciu_base);
 			return -EBUSY;
+		}
 
 		vr41xx_pci_controller.io_map_base = (unsigned long)io_map_base;
 	}
Signature · 1 line
2.23.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Qinglang Miao

add missing iounmap() of pciu_base on error when failed to init io_map_base.

---
 arch/mips/pci/pci-vr41xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]