From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> Fix to check the return value ('ret_stack') of ftrace_pop_return_trace() instead of passed storage ('ret') because ret_stack becomes NULL in error case. Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> --- kernel/trace/fgraph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 858fb73440ec..e51695441476 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -714,7 +714,7 @@ static unsigned long __ftrace_return_to_handler(struct fgraph_ret_regs *ret_regs ret_stack = ftrace_pop_return_trace(&trace, &ret, frame_pointer); - if (unlikely(!ret)) { + if (unlikely(!ret_stack)) { ftrace_graph_stop(); WARN_ON(1); /* Might as well panic. What else to do? */