Commit 1eeb3367 authored by Huazhong Tan's avatar Huazhong Tan Committed by David S. Miller
Browse files

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: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6ff7ed80
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;
}