From: Nobuhiro Iwamatsu Date: Mon, 16 Feb 2015 01:54:08 +0000 (+0900) Subject: PCI: rcar: Verify that mem_res is 64K-aligned X-Git-Tag: v4.9.8~4490^2~1^7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a27db23a3f697b730422482df7d21c93f84fe4a;p=platform%2Fkernel%2Flinux-rpi3.git PCI: rcar: Verify that mem_res is 64K-aligned The lower 16 bits of the address, which is managed by mem_res, need to be zero. Check the address to verify this. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Bjorn Helgaas Acked-by: Simon Horman --- diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c index dd6b84e..367e28f 100644 --- a/drivers/pci/host/pci-rcar-gen2.c +++ b/drivers/pci/host/pci-rcar-gen2.c @@ -301,6 +301,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)