Skip to contentSkip to conversation

net/hns3: fix MAC enable failed rollback

PATCH Applied Min Hu (Connor) 2 participants 2 messages Apr 29, 2021 – May 4, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/hns3: fix MAC enable failed rollback

From: Huisong Li <[email protected]>

If driver fails to enable MAC, it does not need to rollback the MAC configuration. This patch fixes it.

Fixes bdaf190f8235 ("net/hns3: support link speed autoneg for PF")
---
 drivers/net/hns3/hns3_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/hns3/hns3_ethdev.c +4 -2
index a6f4c92..d0f23e8 100644
@@ -5611,12 +5611,14 @@ hns3_do_start(struct hns3_adapter *hns, bool reset_queue)
 
 	ret = hns3_apply_link_speed(hw);
 	if (ret)
-		goto err_config_mac_mode;
+		goto err_set_link_speed;
 
 	return 0;
 
-err_config_mac_mode:
+err_set_link_speed:
 	(void)hns3_cfg_mac_mode(hw, false);
+
+err_config_mac_mode:
 	hns3_dev_release_mbufs(hns);
 	/*
 	 * Here is exception handling, hns3_reset_all_tqps will have the
Signature · 1 line
2.7.4