Skip to contentSkip to conversation

slub: fix bad scope checking

PATCH Applied Zhang, Yanmin 3 participants 3 messages Apr 1, 2010 – Apr 2, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slub: fix bad scope checking

Function init_kmem_cache_nodes is incorrect when checking upper limitation of kmalloc_caches.

The patch against latest tip/master fixes it.

From: Zhang, Yanmin <[email protected]>

---

mm/slub.c +1 -1
@@ -2153,7 +2153,7 @@ static int init_kmem_cache_nodes(struct 
 	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;