From: Guangbin Huang huangguangbin2@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
This patch deletes goto and replace with return in function hns3_set_ringparam(), as the code should return directly if failed.
Signed-off-by: Guangbin Huang huangguangbin2@huawei.com Reviewed-by: Yunsheng Lin linyunsheng@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 9dcc33e..71d3fb6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -976,8 +976,7 @@ static int hns3_set_ringparam(struct net_device *ndev, if (!tmp_rings) { netdev_err(ndev, "backup ring param failed by allocating memory fail\n"); - ret = -ENOMEM; - goto out; + return -ENOMEM; }
netdev_info(ndev, @@ -1006,9 +1005,8 @@ static int hns3_set_ringparam(struct net_device *ndev,
kfree(tmp_rings);
-out: if (if_running) - ndev->netdev_ops->ndo_open(ndev); + ret = ndev->netdev_ops->ndo_open(ndev);
return ret; }