net: hns3: clear inited state and stop client after failed to register netdev
authorJian Shen <shenjian15@huawei.com>
Sun, 24 Apr 2022 12:57:20 +0000 (20:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:14:36 +0000 (09:14 +0200)
commit88c39408187ce118158c6e5e981439578c1d8e1e
treefd6139b1b2911d01e43e58a815e6fedda02f9170
parentac01adfa7d6d0d739bc93d88400227b8353375b5
net: hns3: clear inited state and stop client after failed to register netdev

[ Upstream commit e98365afc1e94ea1609268866a44112b3572c58b ]

If failed to register netdev, it needs to clear INITED state and stop
client in case of cause problem when concurrency with uninitialized
process of driver.

Fixes: a289a7e5c1d4 ("net: hns3: put off calling register_netdev() until client initialize complete")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c