]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
UBUNTU: SAUCE: {topost} net: hns3: add vector status check before free vector
[mirror_ubuntu-bionic-kernel.git] / drivers / net / ethernet / hisilicon / hns3 / hns3vf / hclgevf_main.c
index ecb5bd0ab59007fac4d6cba476c1c74d8a607431..7112a4a9796d0079919f42a505f7fca150fe415c 100644 (file)
@@ -330,6 +330,12 @@ static int hclgevf_set_handle_info(struct hclgevf_dev *hdev)
 
 static void hclgevf_free_vector(struct hclgevf_dev *hdev, int vector_id)
 {
+       if (hdev->vector_status[vector_id] == HCLGEVF_INVALID_VPORT) {
+               dev_warn(&hdev->pdev->dev,
+                        "vector(vector_id %d) has been freed.\n", vector_id);
+               return;
+       }
+
        hdev->vector_status[vector_id] = HCLGEVF_INVALID_VPORT;
        hdev->num_msi_left += 1;
        hdev->num_msi_used -= 1;