We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7249921 commit c3b0f72Copy full SHA for c3b0f72
kernel/trace/ftrace.c
@@ -2937,6 +2937,16 @@ int ftrace_startup(struct ftrace_ops *ops, int command)
2937
2938
ftrace_startup_enable(command);
2939
2940
+ /*
2941
+ * If ftrace is in an undefined state, we just remove ops from list
2942
+ * to prevent the NULL pointer, instead of totally rolling it back and
2943
+ * free trampoline, because those actions could cause further damage.
2944
+ */
2945
+ if (unlikely(ftrace_disabled)) {
2946
+ __unregister_ftrace_function(ops);
2947
+ return -ENODEV;
2948
+ }
2949
+
2950
ops->flags &= ~FTRACE_OPS_FL_ADDING;
2951
2952
return 0;
0 commit comments