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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 2d6c2cf0c3b..caa4fda50f8 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -533,6 +533,12 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size)
533 LIST_HEAD(pages); 533 LIST_HEAD(pages);
534 int i, cpu; 534 int i, cpu;
535 535
536 /*
537 * Always succeed at resizing a non-existent buffer:
538 */
539 if (!buffer)
540 return size;
541
536 size = DIV_ROUND_UP(size, BUF_PAGE_SIZE); 542 size = DIV_ROUND_UP(size, BUF_PAGE_SIZE);
537 size *= BUF_PAGE_SIZE; 543 size *= BUF_PAGE_SIZE;
538 buffer_size = buffer->pages * BUF_PAGE_SIZE; 544 buffer_size = buffer->pages * BUF_PAGE_SIZE;