diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 7b8722baf153..1752a63f37c0 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -358,9 +358,14 @@ void ftrace_release(void *start, unsigned long size) | |||
358 | 358 | ||
359 | mutex_lock(&ftrace_lock); | 359 | mutex_lock(&ftrace_lock); |
360 | do_for_each_ftrace_rec(pg, rec) { | 360 | do_for_each_ftrace_rec(pg, rec) { |
361 | if ((rec->ip >= s) && (rec->ip < e) && | 361 | if ((rec->ip >= s) && (rec->ip < e)) { |
362 | !(rec->flags & FTRACE_FL_FREE)) | 362 | /* |
363 | * rec->ip is changed in ftrace_free_rec() | ||
364 | * It should not between s and e if record was freed. | ||
365 | */ | ||
366 | FTRACE_WARN_ON(rec->flags & FTRACE_FL_FREE); | ||
363 | ftrace_free_rec(rec); | 367 | ftrace_free_rec(rec); |
368 | } | ||
364 | } while_for_each_ftrace_rec(); | 369 | } while_for_each_ftrace_rec(); |
365 | mutex_unlock(&ftrace_lock); | 370 | mutex_unlock(&ftrace_lock); |
366 | } | 371 | } |