]> git.karo-electronics.de Git - karo-tx-linux.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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 3 Jan 2013 03:33:24 +0000 (03:33 +0000)
commit51e8eac1d5138ab32debce67202b975c08920029
tree3978f6b017c467bf2ef2d9a564584f000998d084
parentd7234ac9765a3985524646572f413d0af2c99bde
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: Ben Hutchings <ben@decadent.org.uk>
kernel/trace/ring_buffer.c