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 8efb5fd commit d40163aCopy full SHA for d40163a
kernel/trace/ftrace.c
@@ -2833,6 +2833,16 @@ int ftrace_startup(struct ftrace_ops *ops, int command)
2833
2834
ftrace_startup_enable(command);
2835
2836
+ /*
2837
+ * If ftrace is in an undefined state, we just remove ops from list
2838
+ * to prevent the NULL pointer, instead of totally rolling it back and
2839
+ * free trampoline, because those actions could cause further damage.
2840
+ */
2841
+ if (unlikely(ftrace_disabled)) {
2842
+ __unregister_ftrace_function(ops);
2843
+ return -ENODEV;
2844
+ }
2845
+
2846
ops->flags &= ~FTRACE_OPS_FL_ADDING;
2847
2848
return 0;
0 commit comments