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 @@ -5427,6 +5427,8 @@ static struct ftrace_ops stub_ops = {
5427
5427
* it is safe to modify the ftrace record, where it should be
5428
5428
* currently calling @old_addr directly, to call @new_addr.
5429
5429
*
5430
+ * This is called with direct_mutex locked.
5431
+ *
5430
5432
* Safety checks should be made to make sure that the code at
5431
5433
* @rec->ip is currently calling @old_addr. And this must
5432
5434
* also update entry->direct to @new_addr.
@@ -5439,6 +5441,8 @@ int __weak ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
5439
5441
unsigned long ip = rec -> ip ;
5440
5442
int ret ;
5441
5443
5444
+ lockdep_assert_held (& direct_mutex );
5445
+
5442
5446
/*
5443
5447
* The ftrace_lock was used to determine if the record
5444
5448
* had more than one registered user to it. If it did,
@@ -5461,7 +5465,7 @@ int __weak ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
5461
5465
if (ret )
5462
5466
goto out_lock ;
5463
5467
5464
- ret = register_ftrace_function (& stub_ops );
5468
+ ret = register_ftrace_function_nolock (& stub_ops );
5465
5469
if (ret ) {
5466
5470
ftrace_set_filter_ip (& stub_ops , ip , 1 , 0 );
5467
5471
goto out_lock ;
You can’t perform that action at this time.
0 commit comments