Skip to contentSkip to conversation

tracing: missing error code in tracer_alloc_buffers()

PATCH New Dan Carpenter 1 participant 1 message Aug 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing: missing error code in tracer_alloc_buffers()

If ring_buffer_alloc() or one of the next couple function calls fail then we should return -ENOMEM but the current code returns success.

Fixes b32614c03413 ('tracing/rb: Convert to hotplug state machine')
kernel/trace/trace.c +1 -0
index 42b9355033d4..625c00aab800 100644
@@ -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;