Commit cd9100ca authored by Shiraz Saleem's avatar Shiraz Saleem Committed by Doug Ledford

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: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 01df7f5a
...@@ -1400,6 +1400,11 @@ static enum i40iw_status_code i40iw_save_msix_info(struct i40iw_device *iwdev, ...@@ -1400,6 +1400,11 @@ static enum i40iw_status_code i40iw_save_msix_info(struct i40iw_device *iwdev,
u32 i; u32 i;
u32 size; u32 size;
if (!ldev->msix_count) {
i40iw_pr_err("No MSI-X vectors\n");
return I40IW_ERR_CONFIG;
}
iwdev->msix_count = ldev->msix_count; iwdev->msix_count = ldev->msix_count;
size = sizeof(struct i40iw_msix_vector) * iwdev->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, ...@@ -1550,7 +1555,7 @@ static enum i40iw_status_code i40iw_setup_init_state(struct i40iw_handler *hdl,
status = i40iw_save_msix_info(iwdev, ldev); status = i40iw_save_msix_info(iwdev, ldev);
if (status) if (status)
goto exit; return status;
iwdev->hw.dev_context = (void *)ldev->pcidev; iwdev->hw.dev_context = (void *)ldev->pcidev;
iwdev->hw.hw_addr = ldev->hw_addr; iwdev->hw.hw_addr = ldev->hw_addr;
status = i40iw_allocate_dma_mem(&iwdev->hw, status = i40iw_allocate_dma_mem(&iwdev->hw,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment