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 3357c6e commit 2a2d8c5Copy full SHA for 2a2d8c5
kernel/trace/ftrace.c
@@ -5667,12 +5667,15 @@ int modify_ftrace_direct(unsigned long ip,
5667
ret = 0;
5668
}
5669
5670
- if (unlikely(ret && new_direct)) {
5671
- direct->count++;
5672
- list_del_rcu(&new_direct->next);
5673
- synchronize_rcu_tasks();
5674
- kfree(new_direct);
5675
- ftrace_direct_func_count--;
+ if (ret) {
+ direct->addr = old_addr;
+ if (unlikely(new_direct)) {
+ direct->count++;
+ list_del_rcu(&new_direct->next);
+ synchronize_rcu_tasks();
5676
+ kfree(new_direct);
5677
+ ftrace_direct_func_count--;
5678
+ }
5679
5680
5681
out_unlock:
0 commit comments