[PATCH 2/3] kbuffer: Add event if the buffer just fits in kbuffer_read_buffer()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

If the buffer passed in is exactly the size needed to add an event, it will
not because it checks with:

  while (len > kbuf->next - save_curr) {

Instead of

  while (len >= kbuf->next - save_curr) {

Fixes: 05821189 ("kbuffer: Add kbuffer_read_buffer()")
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 src/kbuffer-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kbuffer-parse.c b/src/kbuffer-parse.c
index d43fe5d972fd..4801d432c58c 100644
--- a/src/kbuffer-parse.c
+++ b/src/kbuffer-parse.c
@@ -995,7 +995,7 @@ int kbuffer_read_buffer(struct kbuffer *kbuf, void *buffer, int len)
 		/* Due to timestamps, we must save the current next to use */
 		last_next = kbuf->next;
 
-		while (len > kbuf->next - save_curr) {
+		while (len >= kbuf->next - save_curr) {
 			last_next = kbuf->next;
 			if (!kbuffer_next_event(kbuf, &ts))
 				break;
-- 
2.42.0





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux