Merge tag 'trace-v5.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux-2.6-microblaze.git] / kernel / trace / ftrace.c
index f3ea4e2..30bc880 100644 (file)
@@ -318,7 +318,7 @@ int __register_ftrace_function(struct ftrace_ops *ops)
        if (!ftrace_enabled && (ops->flags & FTRACE_OPS_FL_PERMANENT))
                return -EBUSY;
 
-       if (!core_kernel_data((unsigned long)ops))
+       if (!is_kernel_core_data((unsigned long)ops))
                ops->flags |= FTRACE_OPS_FL_DYNAMIC;
 
        add_ftrace_ops(&ftrace_ops_list, ops);
@@ -5602,10 +5602,11 @@ int modify_ftrace_direct_multi(struct ftrace_ops *ops, unsigned long addr)
                }
        }
 
+       mutex_unlock(&ftrace_lock);
+
        /* Removing the tmp_ops will add the updated direct callers to the functions */
        unregister_ftrace_function(&tmp_ops);
 
-       mutex_unlock(&ftrace_lock);
  out_direct:
        mutex_unlock(&direct_mutex);
        return err;