net: hns3: free irq when exit from abnormal branch
authorYonglong Liu <liuyonglong@huawei.com>
Thu, 13 Jun 2019 09:12:28 +0000 (17:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Jun 2019 02:26:16 +0000 (19:26 -0700)
In hns3_nic_init_irq(), if request irq fail at index i,
the function return directly without releasing irq resources
that already requested, and nowhere else will release them.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 66d733b130b497070728fea84b64bb43858acd2d..73de4b06ba4ddf717db46790f1572b4f06c68df1 100644 (file)
@@ -143,6 +143,7 @@ static int hns3_nic_init_irq(struct hns3_nic_priv *priv)
                if (ret) {
                        netdev_err(priv->netdev, "request irq(%d) fail\n",
                                   tqp_vectors->vector_irq);
+                       hns3_nic_uninit_irq(priv);
                        return ret;
                }