diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 9058240c85ca..0aeb3b93414e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -3508,7 +3508,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3508 | .spd_release = buffer_spd_release, | 3508 | .spd_release = buffer_spd_release, |
3509 | }; | 3509 | }; |
3510 | struct buffer_ref *ref; | 3510 | struct buffer_ref *ref; |
3511 | int size, i; | 3511 | int entries, size, i; |
3512 | size_t ret; | 3512 | size_t ret; |
3513 | 3513 | ||
3514 | if (*ppos & (PAGE_SIZE - 1)) { | 3514 | if (*ppos & (PAGE_SIZE - 1)) { |
@@ -3523,7 +3523,9 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3523 | len &= PAGE_MASK; | 3523 | len &= PAGE_MASK; |
3524 | } | 3524 | } |
3525 | 3525 | ||
3526 | for (i = 0; i < PIPE_BUFFERS && len; i++, len -= PAGE_SIZE) { | 3526 | entries = ring_buffer_entries_cpu(info->tr->buffer, info->cpu); |
3527 | |||
3528 | for (i = 0; i < PIPE_BUFFERS && len && entries; i++, len -= PAGE_SIZE) { | ||
3527 | struct page *page; | 3529 | struct page *page; |
3528 | int r; | 3530 | int r; |
3529 | 3531 | ||
@@ -3564,6 +3566,8 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3564 | spd.partial[i].private = (unsigned long)ref; | 3566 | spd.partial[i].private = (unsigned long)ref; |
3565 | spd.nr_pages++; | 3567 | spd.nr_pages++; |
3566 | *ppos += PAGE_SIZE; | 3568 | *ppos += PAGE_SIZE; |
3569 | |||
3570 | entries = ring_buffer_entries_cpu(info->tr->buffer, info->cpu); | ||
3567 | } | 3571 | } |
3568 | 3572 | ||
3569 | spd.nr_pages = i; | 3573 | spd.nr_pages = i; |