From: Huazhong Tan Date: Thu, 4 Apr 2019 08:17:58 +0000 (+0800) Subject: net: hns3: modify HNS3_NIC_STATE_INITED flag in hns3_reset_notify_uninit_enet X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1eeb3367897a3f9f852e186695e28bb623b09f92;p=openwrt%2Fstaging%2Fblogic.git net: hns3: modify HNS3_NIC_STATE_INITED flag in hns3_reset_notify_uninit_enet In the hns3_reset_notify_uninit_enet() HNS3_NIC_STATE_INITED flag should be checked and cleared firstly. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 0e31f740f1db..0f389a43ff8d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -4128,7 +4128,7 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle) struct hns3_nic_priv *priv = netdev_priv(netdev); int ret; - if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state)) { + if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) { netdev_warn(netdev, "already uninitialized\n"); return 0; } @@ -4150,8 +4150,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle) hns3_put_ring_config(priv); priv->ring_data = NULL; - clear_bit(HNS3_NIC_STATE_INITED, &priv->state); - return ret; }