From: Alexey Dobriyan Date: Thu, 5 Apr 2018 23:21:46 +0000 (-0700) Subject: slab: use 32-bit arithmetic in freelist_randomize() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=302d55d51d04ab92f8b3f6a89d3424299e3efdf7;p=openwrt%2Fstaging%2Fblogic.git 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 Acked-by: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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;