diff options
| author | Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> | 2015-02-15 20:54:08 -0500 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-02-24 01:24:19 -0500 |
| commit | 7a27db23a3f697b730422482df7d21c93f84fe4a (patch) | |
| tree | c0a4c8073b3edf83e83710a48ee7111a6e30180d | |
| parent | ecd06305c9a077ab5aa000cb8027e2c1c872f25f (diff) | |
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 <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
| -rw-r--r-- | drivers/pci/host/pci-rcar-gen2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c index dd6b84e6206c..367e28fa7564 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) | |||
| 301 | if (!mem_res || !mem_res->start) | 301 | if (!mem_res || !mem_res->start) |
| 302 | return -ENODEV; | 302 | return -ENODEV; |
| 303 | 303 | ||
| 304 | if (mem_res->start & 0xFFFF) | ||
| 305 | return -EINVAL; | ||
| 306 | |||
| 304 | priv = devm_kzalloc(&pdev->dev, | 307 | priv = devm_kzalloc(&pdev->dev, |
| 305 | sizeof(struct rcar_pci_priv), GFP_KERNEL); | 308 | sizeof(struct rcar_pci_priv), GFP_KERNEL); |
| 306 | if (!priv) | 309 | if (!priv) |
