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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Dec 2012 17:27:15 +0000 (09:27 -0800)
commit5ccb378e79f35451c5985833e3e4c3a153f1b19e
tree39353f976deb84e04060578940ab7182a0535117
parent0af50117ada9b3af0fe6b68ce0d9ba8c5a0ab02a
ring-buffer: Fix NULL pointer if rb_set_head_page() fails

commit 54f7be5b831254199522523ccab4c3d954bbf576 upstream.

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.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ring_buffer.c