Commit 44950d28 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller
Browse files

net: hns3: add reset checking before set channels



hns3_set_channels() should check the resetting status firstly,
since the device will reinitialize when resetting. If the
reset has not completed, the hns3_set_channels() may access
invalid memory.

Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dda91bd7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4378,6 +4378,9 @@ int hns3_set_channels(struct net_device *netdev,
	u16 org_tqp_num;
	int ret;

	if (hns3_nic_resetting(netdev))
		return -EBUSY;

	if (ch->rx_count || ch->tx_count)
		return -EINVAL;