summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorAntoine Tenart <atenart@kernel.org>2021-12-07 17:57:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 12:54:15 +0300
commit443133330a5d4a3fd429179d460cc297724fefe8 (patch)
tree0d3a60b16b76b3b3f44cfc4db34406bdd53ad91c /net/core
parent58b4c1ce8328b61b2675c2a966f7e8f5f4748289 (diff)
downloadlinux-443133330a5d4a3fd429179d460cc297724fefe8.tar.xz
net-sysfs: update the queue counts in the unregistration path
[ Upstream commit d7dac083414eb5bb99a6d2ed53dc2c1b405224e5 ] When updating Rx and Tx queue kobjects, the queue count should always be updated to match the queue kobjects count. This was not done in the net device unregistration path, fix it. Tracking all queue count updates will allow in a following up patch to detect illegal updates. Signed-off-by: Antoine Tenart <atenart@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/net-sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index af5912360105..99303897b7bb 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1804,6 +1804,9 @@ static void remove_queue_kobjects(struct net_device *dev)
net_rx_queue_update_kobjects(dev, real_rx, 0);
netdev_queue_update_kobjects(dev, real_tx, 0);
+
+ dev->real_num_rx_queues = 0;
+ dev->real_num_tx_queues = 0;
#ifdef CONFIG_SYSFS
kset_unregister(dev->queues_kset);
#endif