Skip to content

Commit 4431333

Browse files
atenartgregkh
authored andcommitted
net-sysfs: update the queue counts in the unregistration path
[ Upstream commit d7dac08 ] 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 <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 58b4c1c commit 4431333

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
@@ -1804,6 +1804,9 @@ static void remove_queue_kobjects(struct net_device *dev)
18041804

18051805
net_rx_queue_update_kobjects(dev, real_rx, 0);
18061806
netdev_queue_update_kobjects(dev, real_tx, 0);
1807+
1808+
dev->real_num_rx_queues = 0;
1809+
dev->real_num_tx_queues = 0;
18071810
#ifdef CONFIG_SYSFS
18081811
kset_unregister(dev->queues_kset);
18091812
#endif

0 commit comments

Comments
 (0)