summaryrefslogtreecommitdiffstats
path: root/mm/page_owner.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_owner.c')
-rw-r--r--mm/page_owner.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/page_owner.c b/mm/page_owner.c
index 033e349f6479..7163a1c44ccf 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -107,8 +107,10 @@ static __init void init_page_owner(void)
/* Initialize dummy and failure stacks and link them to stack_list */
dummy_stack.stack_record = __stack_depot_get_stack_record(dummy_handle);
failure_stack.stack_record = __stack_depot_get_stack_record(failure_handle);
- refcount_set(&dummy_stack.stack_record->count, 1);
- refcount_set(&failure_stack.stack_record->count, 1);
+ if (dummy_stack.stack_record)
+ refcount_set(&dummy_stack.stack_record->count, 1);
+ if (failure_stack.stack_record)
+ refcount_set(&failure_stack.stack_record->count, 1);
dummy_stack.next = &failure_stack;
stack_list = &dummy_stack;
}
@@ -856,6 +858,9 @@ static int stack_print(struct seq_file *m, void *v)
unsigned long nr_entries;
struct stack_record *stack_record = stack->stack_record;
+ if (!stack->stack_record)
+ return 0;
+
nr_entries = stack_record->size;
entries = stack_record->entries;
stack_count = refcount_read(&stack_record->count) - 1;