linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: rcar: Add address check of mem_res
@ 2015-02-13  7:55 Nobuhiro Iwamatsu
  2015-02-13 16:44 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2015-02-13  7:55 UTC (permalink / raw)
  To: bhelgaas; +Cc: valentine.barshak, horms+renesas, linux-pci, Nobuhiro Iwamatsu

lower 16 bits of the address, which is managed by mem_res need to be 0.
This adds address check of lower 16 bits.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
 drivers/pci/host/pci-rcar-gen2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index d9c042f..13b2793 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -351,6 +351,9 @@ static int rcar_pci_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
+	if (mem_res->start & 0xFFFF)
+		return -EINVAL;
+
 	priv->mem_res = *mem_res;
 	/*
 	 * The controller does not support/use port I/O,
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-16  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13  7:55 [PATCH] PCI: rcar: Add address check of mem_res Nobuhiro Iwamatsu
2015-02-13 16:44 ` Simon Horman
2015-02-16  1:53   ` Nobuhiro Iwamatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).