mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
net: hns3: add vector status check before free vector
If the hdev->vector_status[vector_id] is already HCLGE_INVALID_VPORT, should log the error and return. Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e718a93fee
commit
36cbbdf643
@ -2614,6 +2614,12 @@ static irqreturn_t hclge_misc_irq_handle(int irq, void *data)
|
||||
|
||||
static void hclge_free_vector(struct hclge_dev *hdev, int vector_id)
|
||||
{
|
||||
if (hdev->vector_status[vector_id] == HCLGE_INVALID_VPORT) {
|
||||
dev_warn(&hdev->pdev->dev,
|
||||
"vector(vector_id %d) has been freed.\n", vector_id);
|
||||
return;
|
||||
}
|
||||
|
||||
hdev->vector_status[vector_id] = HCLGE_INVALID_VPORT;
|
||||
hdev->num_msi_left += 1;
|
||||
hdev->num_msi_used -= 1;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user