[PATCH 3/7] PCI: Don't convert BAR address to resource if dma_addr_t is too small

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 drivers/pci/probe.c |    5 +++--
 1 file 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,
 			pci_write_config_dword(dev, pos, 0);
 			pci_write_config_dword(dev, pos + 4, 0);
 			res->flags |= IORESOURCE_UNSET;
-			region.start = 0;
-			region.end = sz64;
+			res->start = 0;
+			res->end = sz64;
 			bar_disabled = true;
+			goto out;
 		} else {
 			region.start = l64;
 			region.end = l64 + sz64;

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux