forked from mirrors/linux
		
	net: Adjust TX queue kobjects if number of queues changes during unregister
If the root qdisc for a net device is mqprio, and the driver's ndo_setup_tc() operation dynamically adds and remvoes TX queues, netif_set_real_num_tx_queues() will be called during device unregistration to remove the extra TX queues when the qdisc is destroyed. Currently this causes the corresponding kobjects to be leaked, and the device's reference count never drops to 0. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
This commit is contained in:
		
							parent
							
								
									ac7100ba93
								
							
						
					
					
						commit
						5c56580b74
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -1648,7 +1648,8 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) | ||||||
| 	if (txq < 1 || txq > dev->num_tx_queues) | 	if (txq < 1 || txq > dev->num_tx_queues) | ||||||
| 		return -EINVAL; | 		return -EINVAL; | ||||||
| 
 | 
 | ||||||
| 	if (dev->reg_state == NETREG_REGISTERED) { | 	if (dev->reg_state == NETREG_REGISTERED || | ||||||
|  | 	    dev->reg_state == NETREG_UNREGISTERING) { | ||||||
| 		ASSERT_RTNL(); | 		ASSERT_RTNL(); | ||||||
| 
 | 
 | ||||||
| 		rc = netdev_queue_update_kobjects(dev, dev->real_num_tx_queues, | 		rc = netdev_queue_update_kobjects(dev, dev->real_num_tx_queues, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Ben Hutchings
						Ben Hutchings