File tree 1 file changed +5
-1
lines changed 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -5439,6 +5439,8 @@ static struct ftrace_ops stub_ops = {
5439
5439
* it is safe to modify the ftrace record, where it should be
5440
5440
* currently calling @old_addr directly, to call @new_addr.
5441
5441
*
5442
+ * This is called with direct_mutex locked.
5443
+ *
5442
5444
* Safety checks should be made to make sure that the code at
5443
5445
* @rec->ip is currently calling @old_addr. And this must
5444
5446
* also update entry->direct to @new_addr.
@@ -5451,6 +5453,8 @@ int __weak ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
5451
5453
unsigned long ip = rec -> ip ;
5452
5454
int ret ;
5453
5455
5456
+ lockdep_assert_held (& direct_mutex );
5457
+
5454
5458
/*
5455
5459
* The ftrace_lock was used to determine if the record
5456
5460
* had more than one registered user to it. If it did,
@@ -5473,7 +5477,7 @@ int __weak ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
5473
5477
if (ret )
5474
5478
goto out_lock ;
5475
5479
5476
- ret = register_ftrace_function (& stub_ops );
5480
+ ret = register_ftrace_function_nolock (& stub_ops );
5477
5481
if (ret ) {
5478
5482
ftrace_set_filter_ip (& stub_ops , ip , 1 , 0 );
5479
5483
goto out_lock ;
You can’t perform that action at this time.
0 commit comments