]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ring-buffer: Return 0 on success from ring_buffer_resize()
authorQiujun Huang <hqjagain@gmail.com>
Mon, 19 Oct 2020 14:22:42 +0000 (22:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:51:50 +0000 (11:51 +0100)
commit7c4df0c8776fc0a797ffe2f628eb46408e2105f2
treecb25b33c79a8bddea8b96a8701caac11fe15f1fc
parent07a9b327933bf5419501e04285b89f3f3c4f9e55
ring-buffer: Return 0 on success from ring_buffer_resize()

commit 0a1754b2a97efa644aa6e84d1db5b17c42251483 upstream.

We don't need to check the new buffer size, and the return value
had confused resize_buffer_duplicate_size().
...
ret = ring_buffer_resize(trace_buf->buffer,
per_cpu_ptr(size_buf->data,cpu_id)->entries, cpu_id);
if (ret == 0)
per_cpu_ptr(trace_buf->data, cpu_id)->entries =
per_cpu_ptr(size_buf->data, cpu_id)->entries;
...

Link: https://lkml.kernel.org/r/20201019142242.11560-1-hqjagain@gmail.com
Cc: stable@vger.kernel.org
Fixes: d60da506cbeb3 ("tracing: Add a resize function to make one buffer equivalent to another buffer")
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ring_buffer.c