Merge back earlier ACPICA-related changes for 5.10.
[linux-2.6-microblaze.git] / mm / slub.c
index 68c02b2..6d35740 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -672,12 +672,12 @@ static void slab_fix(struct kmem_cache *s, char *fmt, ...)
 }
 
 static bool freelist_corrupted(struct kmem_cache *s, struct page *page,
-                              void *freelist, void *nextfree)
+                              void **freelist, void *nextfree)
 {
        if ((s->flags & SLAB_CONSISTENCY_CHECKS) &&
-           !check_valid_pointer(s, page, nextfree)) {
-               object_err(s, page, freelist, "Freechain corrupt");
-               freelist = NULL;
+           !check_valid_pointer(s, page, nextfree) && freelist) {
+               object_err(s, page, *freelist, "Freechain corrupt");
+               *freelist = NULL;
                slab_fix(s, "Isolate corrupted freechain");
                return true;
        }
@@ -1413,10 +1413,6 @@ slab_flags_t kmem_cache_flags(unsigned int object_size,
        char *next_block;
        slab_flags_t block_flags;
 
-       /* If slub_debug = 0, it folds into the if conditional. */
-       if (!slub_debug_string)
-               return flags | slub_debug;
-
        len = strlen(name);
        next_block = slub_debug_string;
        /* Go through all blocks of debug options, see if any matches our slab's name */
@@ -1450,7 +1446,7 @@ slab_flags_t kmem_cache_flags(unsigned int object_size,
                }
        }
 
-       return slub_debug;
+       return flags | slub_debug;
 }
 #else /* !CONFIG_SLUB_DEBUG */
 static inline void setup_object_debug(struct kmem_cache *s,
@@ -1494,7 +1490,7 @@ static inline void dec_slabs_node(struct kmem_cache *s, int node,
                                                        int objects) {}
 
 static bool freelist_corrupted(struct kmem_cache *s, struct page *page,
-                              void *freelist, void *nextfree)
+                              void **freelist, void *nextfree)
 {
        return false;
 }
@@ -2184,7 +2180,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page,
                 * 'freelist' is already corrupted.  So isolate all objects
                 * starting at 'freelist'.
                 */
-               if (freelist_corrupted(s, page, freelist, nextfree))
+               if (freelist_corrupted(s, page, &freelist, nextfree))
                        break;
 
                do {