mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	ethtool: Allocate register dump buffer with vmalloc()
Some NICs have huge register files which exceed the maximum heap allocation size. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									6099e3dea9
								
							
						
					
					
						commit
						a77f5db361
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -815,7 +815,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
 | 
			
		|||
	if (regs.len > reglen)
 | 
			
		||||
		regs.len = reglen;
 | 
			
		||||
 | 
			
		||||
	regbuf = kmalloc(reglen, GFP_USER);
 | 
			
		||||
	regbuf = vmalloc(reglen);
 | 
			
		||||
	if (!regbuf)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -830,7 +830,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
 | 
			
		|||
	ret = 0;
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
	kfree(regbuf);
 | 
			
		||||
	vfree(regbuf);
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue