diff options
author | Antoine Tenart <atenart@kernel.org> | 2021-12-07 15:57:24 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-12-08 18:36:32 -0800 |
commit | d7dac083414eb5bb99a6d2ed53dc2c1b405224e5 (patch) | |
tree | 130182bb4d56afd748931c26f3f2d8308dab794d /net/core/net-sysfs.c | |
parent | 16daf3d9ec44ef9a85833f8638ff432ac09a8d18 (diff) | |
download | lwn-d7dac083414eb5bb99a6d2ed53dc2c1b405224e5.tar.gz lwn-d7dac083414eb5bb99a6d2ed53dc2c1b405224e5.zip |
net-sysfs: update the queue counts in the unregistration path
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>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r-- | net/core/net-sysfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 3b2cdbbdc858..33f408c24205 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -1808,6 +1808,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 |