diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 304ec2a73074..4ccdcd4881d2 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -1274,6 +1274,8 @@ static void rb_free_cpu_buffer(struct ring_buffer_per_cpu *cpu_buffer) struct list_head *head = cpu_buffer->pages; struct buffer_page *bpage, *tmp; + irq_work_sync(&cpu_buffer->irq_work.work); + free_buffer_page(cpu_buffer->reader_page); if (head) { @@ -1404,6 +1406,8 @@ ring_buffer_free(struct ring_buffer *buffer) __unregister_cpu_notifier(&buffer->cpu_notify); #endif + irq_work_sync(&buffer->irq_work.work); + for_each_buffer_cpu(buffer, cpu) rb_free_cpu_buffer(buffer->buffers[cpu]);