From: Zhang, Yanmin Date: Thu, 1 Apr 2010 09:32:30 +0000 (+0800) Subject: slub: Fix bad boundary check in init_kmem_cache_nodes() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=111c7d82436db4c7673922b6ba021cebb7d26dd8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git slub: Fix bad boundary check in init_kmem_cache_nodes() Function init_kmem_cache_nodes is incorrect when checking upper limitation of kmalloc_caches. The breakage was introduced by commit 91efd773c74bb26b5409c85ad755d536448e229c ("dma kmalloc handling fixes"). Acked-by: Christoph Lameter Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index 7d6c8b1ccf63..d2a54fe71ea2 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2153,7 +2153,7 @@ static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags) int local_node; if (slab_state >= UP && (s < kmalloc_caches || - s > kmalloc_caches + KMALLOC_CACHES)) + s >= kmalloc_caches + KMALLOC_CACHES)) local_node = page_to_nid(virt_to_page(s)); else local_node = 0;