Skip to content

Commit

Permalink
PCI: rcar: Verify that mem_res is 64K-aligned
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nobuhiro Iwamatsu authored and Bjorn Helgaas committed Feb 24, 2015
1 parent ecd0630 commit 7a27db2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/pci/host/pci-rcar-gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7a27db2

Please sign in to comment.