if (stack_name)
                        printk("%s <%s>\n", log_lvl, stack_name);
 
+               if (regs && on_stack(&stack_info, regs, sizeof(*regs)))
+                       __show_regs(regs, 0);
+
                /*
                 * Scan the stack, printing any text addresses we find.  At the
                 * same time, follow proper stack frames with the unwinder.
                         * Don't print regs->ip again if it was already printed
                         * by __show_regs() below.
                         */
-                       if (regs && stack == ®s->ip) {
-                               unwind_next_frame(&state);
-                               continue;
-                       }
+                       if (regs && stack == ®s->ip)
+                               goto next;
 
                        if (stack == ret_addr_p)
                                reliable = 1;
                        if (!reliable)
                                continue;
 
+next:
                        /*
                         * Get the next frame from the unwinder.  No need to
                         * check for an error: if anything goes wrong, the rest
 
                        /* if the frame has entry regs, print them */
                        regs = unwind_get_entry_regs(&state);
-                       if (regs)
+                       if (regs && on_stack(&stack_info, regs, sizeof(*regs)))
                                __show_regs(regs, 0);
                }