Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a27db23 authored by Nobuhiro Iwamatsu's avatar Nobuhiro Iwamatsu Committed by Bjorn Helgaas
Browse files

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: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent ecd06305
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -301,6 +301,9 @@ static int rcar_pci_probe(struct platform_device *pdev)
	if (!mem_res || !mem_res->start)
	if (!mem_res || !mem_res->start)
		return -ENODEV;
		return -ENODEV;


	if (mem_res->start & 0xFFFF)
		return -EINVAL;

	priv = devm_kzalloc(&pdev->dev,
	priv = devm_kzalloc(&pdev->dev,
			    sizeof(struct rcar_pci_priv), GFP_KERNEL);
			    sizeof(struct rcar_pci_priv), GFP_KERNEL);
	if (!priv)
	if (!priv)