diff options
Diffstat (limited to 'drivers/infiniband/hw/mthca')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index 8b00d9a0f6f4..9c849d27b06e 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c | |||
@@ -155,6 +155,13 @@ static int __devinit mthca_dev_lim(struct mthca_dev *mdev, struct mthca_dev_lim | |||
155 | return -ENODEV; | 155 | return -ENODEV; |
156 | } | 156 | } |
157 | 157 | ||
158 | if (dev_lim->uar_size > pci_resource_len(mdev->pdev, 2)) { | ||
159 | mthca_err(mdev, "HCA reported UAR size of 0x%x bigger than " | ||
160 | "PCI resource 2 size of 0x%lx, aborting.\n", | ||
161 | dev_lim->uar_size, pci_resource_len(mdev->pdev, 2)); | ||
162 | return -ENODEV; | ||
163 | } | ||
164 | |||
158 | mdev->limits.num_ports = dev_lim->num_ports; | 165 | mdev->limits.num_ports = dev_lim->num_ports; |
159 | mdev->limits.vl_cap = dev_lim->max_vl; | 166 | mdev->limits.vl_cap = dev_lim->max_vl; |
160 | mdev->limits.mtu_cap = dev_lim->max_mtu; | 167 | mdev->limits.mtu_cap = dev_lim->max_mtu; |
@@ -976,8 +983,7 @@ static int __devinit mthca_init_one(struct pci_dev *pdev, | |||
976 | err = -ENODEV; | 983 | err = -ENODEV; |
977 | goto err_disable_pdev; | 984 | goto err_disable_pdev; |
978 | } | 985 | } |
979 | if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM) || | 986 | if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) { |
980 | pci_resource_len(pdev, 2) != 1 << 23) { | ||
981 | dev_err(&pdev->dev, "Missing UAR, aborting.\n"); | 987 | dev_err(&pdev->dev, "Missing UAR, aborting.\n"); |
982 | err = -ENODEV; | 988 | err = -ENODEV; |
983 | goto err_disable_pdev; | 989 | goto err_disable_pdev; |