All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: Kangjie Lu <kjlu@umn.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Vinod Koul <vkoul@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] tty: 8250: fix a missing check for pci_ioremap_bar
Date: Sun, 24 Mar 2019 14:31:11 +0200	[thread overview]
Message-ID: <CAHp75VeyL-G9i=ABg8r6R7+oBBYRDM82L2-jFEm1uK0-136aMw@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VfbPue803w06GdJwU_JYcFKEcShLpyGRMhOg9xi4ZwpAA@mail.gmail.com>

On Sun, Mar 24, 2019 at 2:26 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sun, Mar 24, 2019 at 2:05 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Sun, Mar 24, 2019 at 12:55 AM Aditya Pakki <pakki001@umn.edu> wrote:
> > >
> > > pci_ioremap_bar could fail. The fix captures the failure and
> > > pass an error code upstream. This can avoid potential NULL
> > > pointer dereferences in the future.
> > >
> >
> > NAK.
> > This will break non-DMA case.
>
> > > @@ -172,12 +172,14 @@ static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port)
>
> Just to clarify, what you need is simple
>

> void __iomem *regs;

Sorry for leftover.

> chip->pdata = ... //move it here for better looking code
> chip->irq = ...

> chip->regs = pci_ioremap_bar(...);

And looking into the code it needs pci_iounmap() on exit one.

> if (!chip->regs)
>   return;
>
> and thank you for pointing to this.

-- 
With Best Regards,
Andy Shevchenko

      reply	other threads:[~2019-03-24 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 22:53 [PATCH v2] tty: 8250: fix a missing check for pci_ioremap_bar Aditya Pakki
2019-03-24 12:05 ` Andy Shevchenko
2019-03-24 12:26   ` Andy Shevchenko
2019-03-24 12:31     ` Andy Shevchenko [this message]

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='CAHp75VeyL-G9i=ABg8r6R7+oBBYRDM82L2-jFEm1uK0-136aMw@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=vkoul@kernel.org \
    /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.