Skip to content

Commit

Permalink
ring-buffer: Fix ring buffer size in rb_write_something()
Browse files Browse the repository at this point in the history
'cnt' should be used to calculate ring buffer size rather than data->cnt

Link: http://lkml.kernel.org/r/1537704693-184237-1-git-send-email-yuehaibing@huawei.com

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
YueHaibing authored and Steven Rostedt (VMware) committed Apr 2, 2019
1 parent 79a3aaa commit 40ed29b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -4979,7 +4979,7 @@ static __init int rb_write_something(struct rb_test_data *data, bool nested)
cnt = data->cnt + (nested ? 27 : 0);

/* Multiply cnt by ~e, to make some unique increment */
size = (data->cnt * 68 / 25) % (sizeof(rb_string) - 1);
size = (cnt * 68 / 25) % (sizeof(rb_string) - 1);

len = size + sizeof(struct rb_item);

Expand Down

0 comments on commit 40ed29b

Please sign in to comment.