mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	slab: use 32-bit arithmetic in freelist_randomize()
SLAB doesn't support 4GB+ of objects per slab, therefore randomization doesn't need size_t. Link: http://lkml.kernel.org/r/20180305200730.15812-25-adobriyan@gmail.com Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									870b1fbb03
								
							
						
					
					
						commit
						302d55d51d
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -1186,10 +1186,10 @@ EXPORT_SYMBOL(kmalloc_order_trace); | |||
| #ifdef CONFIG_SLAB_FREELIST_RANDOM | ||||
| /* Randomize a generic freelist */ | ||||
| static void freelist_randomize(struct rnd_state *state, unsigned int *list, | ||||
| 			size_t count) | ||||
| 			       unsigned int count) | ||||
| { | ||||
| 	size_t i; | ||||
| 	unsigned int rand; | ||||
| 	unsigned int i; | ||||
| 
 | ||||
| 	for (i = 0; i < count; i++) | ||||
| 		list[i] = i; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Alexey Dobriyan
						Alexey Dobriyan