aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ring_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r--kernel/trace/ring_buffer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 2c839ca5e5ce..41ca394feb22 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1210,18 +1210,19 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
1210 1210
1211 for (i = 0; i < nr_pages; i++) { 1211 for (i = 0; i < nr_pages; i++) {
1212 if (RB_WARN_ON(cpu_buffer, list_empty(cpu_buffer->pages))) 1212 if (RB_WARN_ON(cpu_buffer, list_empty(cpu_buffer->pages)))
1213 return; 1213 goto out;
1214 p = cpu_buffer->pages->next; 1214 p = cpu_buffer->pages->next;
1215 bpage = list_entry(p, struct buffer_page, list); 1215 bpage = list_entry(p, struct buffer_page, list);
1216 list_del_init(&bpage->list); 1216 list_del_init(&bpage->list);
1217 free_buffer_page(bpage); 1217 free_buffer_page(bpage);
1218 } 1218 }
1219 if (RB_WARN_ON(cpu_buffer, list_empty(cpu_buffer->pages))) 1219 if (RB_WARN_ON(cpu_buffer, list_empty(cpu_buffer->pages)))
1220 return; 1220 goto out;
1221 1221
1222 rb_reset_cpu(cpu_buffer); 1222 rb_reset_cpu(cpu_buffer);
1223 rb_check_pages(cpu_buffer); 1223 rb_check_pages(cpu_buffer);
1224 1224
1225out:
1225 spin_unlock_irq(&cpu_buffer->reader_lock); 1226 spin_unlock_irq(&cpu_buffer->reader_lock);
1226} 1227}
1227 1228
@@ -1238,7 +1239,7 @@ rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer,
1238 1239
1239 for (i = 0; i < nr_pages; i++) { 1240 for (i = 0; i < nr_pages; i++) {
1240 if (RB_WARN_ON(cpu_buffer, list_empty(pages))) 1241 if (RB_WARN_ON(cpu_buffer, list_empty(pages)))
1241 return; 1242 goto out;
1242 p = pages->next; 1243 p = pages->next;
1243 bpage = list_entry(p, struct buffer_page, list); 1244 bpage = list_entry(p, struct buffer_page, list);
1244 list_del_init(&bpage->list); 1245 list_del_init(&bpage->list);
@@ -1247,6 +1248,7 @@ rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer,
1247 rb_reset_cpu(cpu_buffer); 1248 rb_reset_cpu(cpu_buffer);
1248 rb_check_pages(cpu_buffer); 1249 rb_check_pages(cpu_buffer);
1249 1250
1251out:
1250 spin_unlock_irq(&cpu_buffer->reader_lock); 1252 spin_unlock_irq(&cpu_buffer->reader_lock);
1251} 1253}
1252 1254