Commit d7dac083 authored by Antoine Tenart's avatar Antoine Tenart Committed by Jakub Kicinski

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: default avatarAntoine Tenart <atenart@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 16daf3d9
...@@ -1808,6 +1808,9 @@ static void remove_queue_kobjects(struct net_device *dev) ...@@ -1808,6 +1808,9 @@ static void remove_queue_kobjects(struct net_device *dev)
net_rx_queue_update_kobjects(dev, real_rx, 0); net_rx_queue_update_kobjects(dev, real_rx, 0);
netdev_queue_update_kobjects(dev, real_tx, 0); netdev_queue_update_kobjects(dev, real_tx, 0);
dev->real_num_rx_queues = 0;
dev->real_num_tx_queues = 0;
#ifdef CONFIG_SYSFS #ifdef CONFIG_SYSFS
kset_unregister(dev->queues_kset); kset_unregister(dev->queues_kset);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment