tracing: Missing error code in tracer_alloc_buffers()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 1 Aug 2017 11:02:01 +0000 (14:02 +0300)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 2 Aug 2017 18:19:57 +0000 (14:19 -0400)
If ring_buffer_alloc() or one of the next couple function calls fail
then we should return -ENOMEM but the current code returns success.

Link: http://lkml.kernel.org/r/20170801110201.ajdkct7vwzixahvx@mwanda
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: stable@vger.kernel.org
Fixes: b32614c03413 ('tracing/rb: Convert to hotplug state machine')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c

index 784fb43b2abeedf150e17fda4d7e43cf078c578b..d815fc317e9d77aa3ff36a323f4752878cfbae44 100644 (file)
@@ -8293,6 +8293,7 @@ __init static int tracer_alloc_buffers(void)
        if (ret < 0)
                goto out_free_cpumask;
        /* Used for event triggers */
+       ret = -ENOMEM;
        temp_buffer = ring_buffer_alloc(PAGE_SIZE, RB_FL_OVERWRITE);
        if (!temp_buffer)
                goto out_rm_hp_state;