summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/i40iw
diff options
context:
space:
mode:
authorShiraz Saleem <shiraz.saleem@intel.com>2017-09-19 16:19:09 +0200
committerDoug Ledford <dledford@redhat.com>2017-09-22 19:43:36 +0200
commitcd9100ca9e78eb03bf5a0ee2ba98ebdc8cc5880e (patch)
tree6f4cd20dd954f7abead039fc2687bbf23de61b0c /drivers/infiniband/hw/i40iw
parentRDMA/vmw_pvrdma: Fix reporting correct opcodes for completion (diff)
downloadlinux-cd9100ca9e78eb03bf5a0ee2ba98ebdc8cc5880e.tar.xz
linux-cd9100ca9e78eb03bf5a0ee2ba98ebdc8cc5880e.zip
i40iw: Fail open if there are no available MSI-X vectors
Check number of available MSI-X vectors for i40iw. If there are no available vectors, fail the open. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/i40iw')
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c
index cc742c3132c6..5965b59a2f83 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_main.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_main.c
@@ -1400,6 +1400,11 @@ static enum i40iw_status_code i40iw_save_msix_info(struct i40iw_device *iwdev,
u32 i;
u32 size;
+ if (!ldev->msix_count) {
+ i40iw_pr_err("No MSI-X vectors\n");
+ return I40IW_ERR_CONFIG;
+ }
+
iwdev->msix_count = ldev->msix_count;
size = sizeof(struct i40iw_msix_vector) * iwdev->msix_count;
@@ -1550,7 +1555,7 @@ static enum i40iw_status_code i40iw_setup_init_state(struct i40iw_handler *hdl,
status = i40iw_save_msix_info(iwdev, ldev);
if (status)
- goto exit;
+ return status;
iwdev->hw.dev_context = (void *)ldev->pcidev;
iwdev->hw.hw_addr = ldev->hw_addr;
status = i40iw_allocate_dma_mem(&iwdev->hw,