Skip to content

Commit d7dac08

Browse files
atenartkuba-moo
authored andcommitted
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>
1 parent 16daf3d commit d7dac08

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/core/net-sysfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,9 @@ static void remove_queue_kobjects(struct net_device *dev)
18081808

18091809
net_rx_queue_update_kobjects(dev, real_rx, 0);
18101810
netdev_queue_update_kobjects(dev, real_tx, 0);
1811+
1812+
dev->real_num_rx_queues = 0;
1813+
dev->real_num_tx_queues = 0;
18111814
#ifdef CONFIG_SYSFS
18121815
kset_unregister(dev->queues_kset);
18131816
#endif

0 commit comments

Comments
 (0)