linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] console: fix an issue about ioremap leak.
@ 2020-04-22 15:53 Dejin Zheng
  2020-04-23 11:10 ` Markus Elfring
  0 siblings, 1 reply; 9+ messages in thread
From: Dejin Zheng @ 2020-04-22 15:53 UTC (permalink / raw)
  To: b.zolnierkie, tglx, gregkh, tsbogend, FlorianSchandinat, ralf,
	dri-devel, linux-fbdev
  Cc: Dejin Zheng, Andy Shevchenko, linux-kernel

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 <andy.shevchenko@gmail.com>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
 drivers/video/console/newport_con.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index 00dddf6e08b0..6bfc8e3ffd4a 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -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;
 }
 
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-04-24  7:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 15:53 [PATCH v1] console: fix an issue about ioremap leak Dejin Zheng
2020-04-23 11:10 ` Markus Elfring
2020-04-23 14:29   ` Dejin Zheng
2020-04-23 15:23     ` console: Complete exception handling in newport_probe() Markus Elfring
2020-04-23 17:02       ` Dejin Zheng
2020-04-23 17:22         ` Markus Elfring
2020-04-23 17:32         ` Greg Kroah-Hartman
2020-04-23 17:43           ` Markus Elfring
2020-04-24  7:46         ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).