Commit 302d55d5 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

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.comSigned-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Acked-by: default avatarChristoph 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 870b1fbb
...@@ -1186,10 +1186,10 @@ EXPORT_SYMBOL(kmalloc_order_trace); ...@@ -1186,10 +1186,10 @@ EXPORT_SYMBOL(kmalloc_order_trace);
#ifdef CONFIG_SLAB_FREELIST_RANDOM #ifdef CONFIG_SLAB_FREELIST_RANDOM
/* Randomize a generic freelist */ /* Randomize a generic freelist */
static void freelist_randomize(struct rnd_state *state, unsigned int *list, 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 rand;
unsigned int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
list[i] = i; list[i] = i;
......
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