diff mbox series

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

Message ID 20201028091548.136303-1-miaoqinglang@huawei.com (mailing list archive)
State Accepted
Commit c424dc4cd1809e181a161723f770b7bc1e0f9927
Headers show
Series mips: Vr41xx: add missing iounmap() on error in vr41xx_pciu_init() | expand

Commit Message

Qinglang Miao Oct. 28, 2020, 9:15 a.m. UTC
add missing iounmap() of pciu_base on error when failed to init
io_map_base.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 arch/mips/pci/pci-vr41xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Thomas Bogendoerfer Nov. 6, 2020, 10:50 a.m. UTC | #1
On Wed, Oct 28, 2020 at 05:15:48PM +0800, Qinglang Miao wrote:
> add missing iounmap() of pciu_base on error when failed to init
> io_map_base.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
>  arch/mips/pci/pci-vr41xx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

applied to mips-next.

Thomas.
diff mbox series

Patch

diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c
index 1fa4e1014..4f250c55b 100644
--- a/arch/mips/pci/pci-vr41xx.c
+++ b/arch/mips/pci/pci-vr41xx.c
@@ -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;
 	}