Skip to content

Commit

Permalink
tracing: Missing error code in tracer_alloc_buffers()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: [email protected]
Fixes: b32614c ('tracing/rb: Convert to hotplug state machine')
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
Dan Carpenter authored and rostedt committed Aug 2, 2017
1 parent 4bb0f0e commit 147d88e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 147d88e

Please sign in to comment.