Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nobuhiro Iwamatsu and committed by
Bjorn Helgaas
7a27db23 ecd06305

+3
+3
drivers/pci/host/pci-rcar-gen2.c
··· 301 301 if (!mem_res || !mem_res->start) 302 302 return -ENODEV; 303 303 304 + if (mem_res->start & 0xFFFF) 305 + return -EINVAL; 306 + 304 307 priv = devm_kzalloc(&pdev->dev, 305 308 sizeof(struct rcar_pci_priv), GFP_KERNEL); 306 309 if (!priv)