From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com ([209.85.192.182]:37640 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbbBXG03 (ORCPT ); Tue, 24 Feb 2015 01:26:29 -0500 Received: by pdbfl12 with SMTP id fl12so31143282pdb.4 for ; Mon, 23 Feb 2015 22:26:28 -0800 (PST) Date: Tue, 24 Feb 2015 00:26:24 -0600 From: Bjorn Helgaas To: Nobuhiro Iwamatsu 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 Message-ID: <20150224062624.GD6220@google.com> References: <1424051648-7430-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1424051648-7430-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> Sender: linux-pci-owner@vger.kernel.org List-ID: 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 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 >