Skip to contentSkip to conversation

console: fix an issue about ioremap leak.

PATCH New Dejin Zheng 1 participant 1 message Apr 22, 2020

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

PATCH 1/1 console: fix an issue about ioremap leak.

if do_take_over_console() return an error in the newport_probe(), due to the io virtual address is not released, it will cause a leak.

Fixes e84de0c6190503 ("MIPS: GIO bus support for SGI IP22/28")
CC Andy Shevchenko <[email protected]>
---
 drivers/video/console/newport_con.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/video/console/newport_con.c +3 -0
index 00dddf6e08b0..6bfc8e3ffd4a 100644
@@ -720,6 +720,9 @@ static int newport_probe(struct gio_device *dev,
 	console_lock();
 	err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
 	console_unlock();
+
+	if (err)
+		iounmap((void *)npregs);
 	return err;
 }
 
Signature · 1 line
2.25.0