diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 43c3c247e82f3c09c0224a1697d6d521e3294caa..332edb76ea9cca23a9922e26791da410fc69e488 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -7138,14 +7138,16 @@ static int __hns_roce_request_irq(struct hns_roce_dev *hr_dev, int irq_num, return 0; err_request_failed: - for (j -= 1; j >= 0; j--) + for (j -= 1; j >= 0; j--) { if (j < other_num) { free_irq(hr_dev->irq[j], hr_dev); - } else { - free_irq(eq_table->eq[j - other_num].irq, - &eq_table->eq[j - other_num]); - tasklet_kill(&eq_table->eq[j - other_num].tasklet); + continue; } + free_irq(eq_table->eq[j - other_num].irq, + &eq_table->eq[j - other_num]); + if (j < other_num + comp_num) + tasklet_kill(&eq_table->eq[j - other_num].tasklet); + } err_kzalloc_failed: for (i -= 1; i >= 0; i--)