mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
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: Jian Shen <shenjian15@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
dda91bd7ab
commit
44950d28cc
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user