From: Dejin Zheng <zhengdejin5@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-fbdev@vger.kernel.org,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
FlorianSchandinat@gmx.de,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe()
Date: Thu, 23 Apr 2020 16:03:56 +0000 [thread overview]
Message-ID: <20200423160356.GA2538@nuc8i5> (raw)
In-Reply-To: <CAHp75Vf1_SMk=_WDUrB97BGR6K6EXOdtgQ92=hTyMdVUoyWQiw@mail.gmail.com>
On Thu, Apr 23, 2020 at 05:52:09PM +0300, Andy Shevchenko wrote:
> On Thu, Apr 23, 2020 at 5:26 PM Dejin Zheng <zhengdejin5@gmail.com> wrote:
> >
> > A call of the function do_take_over_console() can fail here.
> > The corresponding system resources were not released then.
> > Thus add a call of the function iounmap() together with the check
> > of a failure predicate.
>
> ...
>
> > CC: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> Use Cc: Better to read.
>
I will pay attention to the next submission, thanks.
> ...
>
> > v1 -> v2:
> > - modify the commit comments by Markus'suggestion.
>
> What suggestion? You need to be clear in changelog what exactly has
> been done without looking to any previous mail.
>
The commit comments have some more appropriate instructions by
Markus'suggestion. here is my first version commit comments:
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.
Thnaks!
> ...
>
> > console_lock();
> > err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> > console_unlock();
> > +
> > + if (err)
> > + iounmap((void *)npregs);
> > return err;
> > }
>
> I have briefly looked at the code (it is actually quite old one!), and
> I think this is half-baked solution, besides the fact of missed
> __iomem annotation and useless explicit casting.
> The proper one seems to switch to memremap() and do memunmap() here.
>
> --
> With Best Regards,
> Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: Dejin Zheng <zhengdejin5@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-fbdev@vger.kernel.org,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
FlorianSchandinat@gmx.de,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe()
Date: Fri, 24 Apr 2020 00:03:56 +0800 [thread overview]
Message-ID: <20200423160356.GA2538@nuc8i5> (raw)
In-Reply-To: <CAHp75Vf1_SMk=_WDUrB97BGR6K6EXOdtgQ92=hTyMdVUoyWQiw@mail.gmail.com>
On Thu, Apr 23, 2020 at 05:52:09PM +0300, Andy Shevchenko wrote:
> On Thu, Apr 23, 2020 at 5:26 PM Dejin Zheng <zhengdejin5@gmail.com> wrote:
> >
> > A call of the function do_take_over_console() can fail here.
> > The corresponding system resources were not released then.
> > Thus add a call of the function iounmap() together with the check
> > of a failure predicate.
>
> ...
>
> > CC: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> Use Cc: Better to read.
>
I will pay attention to the next submission, thanks.
> ...
>
> > v1 -> v2:
> > - modify the commit comments by Markus'suggestion.
>
> What suggestion? You need to be clear in changelog what exactly has
> been done without looking to any previous mail.
>
The commit comments have some more appropriate instructions by
Markus'suggestion. here is my first version commit comments:
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.
Thnaks!
> ...
>
> > console_lock();
> > err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> > console_unlock();
> > +
> > + if (err)
> > + iounmap((void *)npregs);
> > return err;
> > }
>
> I have briefly looked at the code (it is actually quite old one!), and
> I think this is half-baked solution, besides the fact of missed
> __iomem annotation and useless explicit casting.
> The proper one seems to switch to memremap() and do memunmap() here.
>
> --
> With Best Regards,
> Andy Shevchenko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Dejin Zheng <zhengdejin5@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
FlorianSchandinat@gmx.de,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Ralf Baechle <ralf@linux-mips.org>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
dri-devel <dri-devel@lists.freedesktop.org>,
linux-fbdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe()
Date: Fri, 24 Apr 2020 00:03:56 +0800 [thread overview]
Message-ID: <20200423160356.GA2538@nuc8i5> (raw)
In-Reply-To: <CAHp75Vf1_SMk=_WDUrB97BGR6K6EXOdtgQ92=hTyMdVUoyWQiw@mail.gmail.com>
On Thu, Apr 23, 2020 at 05:52:09PM +0300, Andy Shevchenko wrote:
> On Thu, Apr 23, 2020 at 5:26 PM Dejin Zheng <zhengdejin5@gmail.com> wrote:
> >
> > A call of the function do_take_over_console() can fail here.
> > The corresponding system resources were not released then.
> > Thus add a call of the function iounmap() together with the check
> > of a failure predicate.
>
> ...
>
> > CC: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> Use Cc: Better to read.
>
I will pay attention to the next submission, thanks.
> ...
>
> > v1 -> v2:
> > - modify the commit comments by Markus'suggestion.
>
> What suggestion? You need to be clear in changelog what exactly has
> been done without looking to any previous mail.
>
The commit comments have some more appropriate instructions by
Markus'suggestion. here is my first version commit comments:
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.
Thnaks!
> ...
>
> > console_lock();
> > err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> > console_unlock();
> > +
> > + if (err)
> > + iounmap((void *)npregs);
> > return err;
> > }
>
> I have briefly looked at the code (it is actually quite old one!), and
> I think this is half-baked solution, besides the fact of missed
> __iomem annotation and useless explicit casting.
> The proper one seems to switch to memremap() and do memunmap() here.
>
> --
> With Best Regards,
> Andy Shevchenko
next prev parent reply other threads:[~2020-04-23 16:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200423142637eucas1p2ea543e281d96c75aa4292b49756f2146@eucas1p2.samsung.com>
2020-04-23 14:26 ` [PATCH v2] console: console: Complete exception handling in newport_probe() Dejin Zheng
2020-04-23 14:26 ` Dejin Zheng
2020-04-23 14:26 ` Dejin Zheng
2020-04-23 14:52 ` Andy Shevchenko
2020-04-23 14:52 ` Andy Shevchenko
2020-04-23 14:52 ` Andy Shevchenko
2020-04-23 16:03 ` Dejin Zheng [this message]
2020-04-23 16:03 ` Dejin Zheng
2020-04-23 16:03 ` Dejin Zheng
2020-04-23 14:55 ` Bartlomiej Zolnierkiewicz
2020-04-23 14:55 ` Bartlomiej Zolnierkiewicz
2020-04-23 14:55 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:05 ` Andy Shevchenko
2020-04-23 15:05 ` Andy Shevchenko
2020-04-23 15:05 ` Andy Shevchenko
2020-04-23 15:25 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:25 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:25 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:51 ` Dejin Zheng
2020-04-23 15:51 ` Dejin Zheng
2020-04-23 15:51 ` 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=20200423160356.GA2538@nuc8i5 \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.