X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=lib%2Fstackdepot.c;h=81c69c08d1d157189d253a0cbe2a2bbd82cff421;hb=82f2bc2fcc0160d6f82dd1ac64518ae0a4dd183f;hp=ed717dd08ff37216a7c90a531f23b2eac0e2be1a;hpb=6c9594bdd47412ebf74616593b9dcad67c4e9e00;p=linux-2.6-microblaze.git diff --git a/lib/stackdepot.c b/lib/stackdepot.c index ed717dd08ff3..81c69c08d1d1 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -83,15 +83,19 @@ static bool init_stack_slab(void **prealloc) return true; if (stack_slabs[depot_index] == NULL) { stack_slabs[depot_index] = *prealloc; + *prealloc = NULL; } else { - stack_slabs[depot_index + 1] = *prealloc; + /* If this is the last depot slab, do not touch the next one. */ + if (depot_index + 1 < STACK_ALLOC_MAX_SLABS) { + stack_slabs[depot_index + 1] = *prealloc; + *prealloc = NULL; + } /* * This smp_store_release pairs with smp_load_acquire() from * |next_slab_inited| above and in stack_depot_save(). */ smp_store_release(&next_slab_inited, 1); } - *prealloc = NULL; return true; }