linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dejin Zheng <zhengdejin5@gmail.com>
To: b.zolnierkie@samsung.com, tglx@linutronix.de,
	gregkh@linuxfoundation.org, tsbogend@alpha.franken.de,
	FlorianSchandinat@gmx.de, ralf@linux-mips.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Dejin Zheng <zhengdejin5@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH v1] console: fix an issue about ioremap leak.
Date: Wed, 22 Apr 2020 23:53:28 +0800	[thread overview]
Message-ID: <20200422155328.27473-1-zhengdejin5@gmail.com> (raw)

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


             reply	other threads:[~2020-04-22 15:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 15:53 Dejin Zheng [this message]
2020-04-23 11:10 [PATCH v1] console: fix an issue about ioremap leak Markus Elfring
2020-04-23 14:29 ` Dejin Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200422155328.27473-1-zhengdejin5@gmail.com \
    --to=zhengdejin5@gmail.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).