diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-04-29 20:42:49 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-05-23 12:47:20 -0400 |
commit | 72dc5601fe5fec37cc1bd0efb19d99948fe7e54c (patch) | |
tree | b8c874a0633ce7ce9111dd4f3b83aa06a4206f36 /drivers/pci/probe.c | |
parent | d1a313e4b6ccbb61c746ee10ac198970516e9afc (diff) |
PCI: Don't convert BAR address to resource if dma_addr_t is too small
If dma_addr_t is too small to represent the BAR value,
pcibios_bus_to_resource() will fail, so just remember the BAR size directly
in the resource. The resource is already marked UNSET, so we know the
address isn't valid anyway.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index afae3bf405fa..82cd75f6118a 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -258,9 +258,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
258 | pci_write_config_dword(dev, pos, 0); | 258 | pci_write_config_dword(dev, pos, 0); |
259 | pci_write_config_dword(dev, pos + 4, 0); | 259 | pci_write_config_dword(dev, pos + 4, 0); |
260 | res->flags |= IORESOURCE_UNSET; | 260 | res->flags |= IORESOURCE_UNSET; |
261 | region.start = 0; | 261 | res->start = 0; |
262 | region.end = sz64; | 262 | res->end = sz64; |
263 | bar_disabled = true; | 263 | bar_disabled = true; |
264 | goto out; | ||
264 | } else { | 265 | } else { |
265 | region.start = l64; | 266 | region.start = l64; |
266 | region.end = l64 + sz64; | 267 | region.end = l64 + sz64; |