From: Huazhong Tan Date: Wed, 30 Jan 2019 20:55:49 +0000 (+0800) Subject: net: hns3: fix improper error handling in the hclge_init_ae_dev() X-Git-Tag: v5.15~6918^2~392^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fc55413270fffe1b5ebdea03489d763c62c0305;p=platform%2Fkernel%2Flinux-starfive.git net: hns3: fix improper error handling in the hclge_init_ae_dev() While hclge_init_umv_space() failed in the hclge_init_ae_dev(), we should undo all the operation which has been done successfully, the last success operation maybe hclge_mac_mdio_config(), so if hclge_init_umv_space() failed, we also need to undo it. Fixes: 288475b2ad01 ("{topost} net: hns3: refine umv space allocation") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 42f0f88..b531eac 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -7383,7 +7383,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) ret = hclge_init_umv_space(hdev); if (ret) { dev_err(&pdev->dev, "umv space init error, ret=%d.\n", ret); - goto err_msi_irq_uninit; + goto err_mdiobus_unreg; } ret = hclge_mac_init(hdev);