]> git.baikalelectronics.ru Git - kernel.git/commit
ring-buffer: Fix NULL pointer if rb_set_head_page() fails
authorSteven Rostedt <srostedt@redhat.com>
Fri, 30 Nov 2012 03:27:22 +0000 (22:27 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 30 Nov 2012 16:09:28 +0000 (11:09 -0500)
commitbce359401d5da6ade25c963f94799ceb28e14293
tree7a65782f3bb7f67438db53444b59e8206916d478
parent8cbdd233528efa17a77b8f04814786f49fd19d3d
ring-buffer: Fix NULL pointer if rb_set_head_page() fails

The function rb_set_head_page() searches the list of ring buffer
pages for a the page that has the HEAD page flag set. If it does
not find it, it will do a WARN_ON(), disable the ring buffer and
return NULL, as this should never happen.

But if this bug happens to happen, not all callers of this function
can handle a NULL pointer being returned from it. That needs to be
fixed.

Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c