diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 39df3192e725b3c0b271735370ed6fa2997409d0..e14ff4c1713eea50c9f73cb0380286435f9511f0 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2637,7 +2637,8 @@ ftrace_allocate_pages(unsigned long num_to_init) return start_pg; free_pages: - while (start_pg) { + pg = start_pg; + while (pg) { order = get_count_order(pg->size / ENTRIES_PER_PAGE); free_pages((unsigned long)pg->records, order); start_pg = pg->next;