linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: valentine.barshak@cogentembedded.com, horms+renesas@verge.net.au,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] PCI: rcar: Add address check of mem_res
Date: Tue, 24 Feb 2015 00:26:24 -0600	[thread overview]
Message-ID: <20150224062624.GD6220@google.com> (raw)
In-Reply-To: <1424051648-7430-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>

On Mon, Feb 16, 2015 at 10:54:08AM +0900, Nobuhiro Iwamatsu wrote:
> lower 16 bits of the address, which is managed by mem_res need to be 0.
> This adds address check of lower 16 bits.
> 
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

Applied to pci/host-rcar for v4.1, thanks!

> ---
>  v2: Remove to before devm_kzalloc().
> 
>  drivers/pci/host/pci-rcar-gen2.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
> index d9c042f..e9617d3 100644
> --- a/drivers/pci/host/pci-rcar-gen2.c
> +++ b/drivers/pci/host/pci-rcar-gen2.c
> @@ -346,6 +346,9 @@ static int rcar_pci_probe(struct platform_device *pdev)
>  	if (!mem_res || !mem_res->start)
>  		return -ENODEV;
>  
> +	if (mem_res->start & 0xFFFF)
> +		return -EINVAL;
> +
>  	priv = devm_kzalloc(&pdev->dev,
>  			    sizeof(struct rcar_pci_priv), GFP_KERNEL);
>  	if (!priv)
> -- 
> 2.1.3
> 

      parent reply	other threads:[~2015-02-24  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16  1:54 [PATCH v2] PCI: rcar: Add address check of mem_res Nobuhiro Iwamatsu
2015-02-16 14:01 ` Simon Horman
2015-02-24  2:06 ` Simon Horman
2015-02-24  6:26 ` Bjorn Helgaas [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=20150224062624.GD6220@google.com \
    --to=bhelgaas@google.com \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-pci@vger.kernel.org \
    --cc=nobuhiro.iwamatsu.yj@renesas.com \
    --cc=valentine.barshak@cogentembedded.com \
    /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).