lkml.org 
[lkml]   [2023]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 19/32] function_graph: Fix to check the return value of ftrace_pop_return_trace()
Date
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

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@kernel.org>
---
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? */
\
 
 \ /
  Last update: 2023-11-20 13:48    [W:0.321 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site