aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dobriyan <[email protected]>2018-04-05 16:21:46 -0700
committerLinus Torvalds <[email protected]>2018-04-05 21:36:24 -0700
commit302d55d51d04ab92f8b3f6a89d3424299e3efdf7 (patch)
tree7e0e2b1e8b625cb48ebddf7106bdb3bce154cc06
parent870b1fbb036c0e115aeb8a48478643c16b73d204 (diff)
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/[email protected] Signed-off-by: Alexey Dobriyan <[email protected]> Acked-by: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/slab_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 01224cb90080..e2e2485b3496 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -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;