Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1702878 > unrolled thread

[for-next][PATCH 2/3] tracing: Missing error code in tracer_alloc_buffers()

Started bySteven Rostedt <rostedt@goodmis.org>
First post2017-08-03 12:10 +0200
Last post2017-08-03 12:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [for-next][PATCH 2/3] tracing: Missing error code in tracer_alloc_buffers() Steven Rostedt <rostedt@goodmis.org> - 2017-08-03 12:10 +0200

#1702878 — [for-next][PATCH 2/3] tracing: Missing error code in tracer_alloc_buffers()

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-08-03 12:10 +0200
Subject[for-next][PATCH 2/3] tracing: Missing error code in tracer_alloc_buffers()
Message-ID<ualeP-6Uy-21@gated-at.bofh.it>
From: Dan Carpenter <dan.carpenter@oracle.com>

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 784fb43b2abe..d815fc317e9d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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;
-- 
2.13.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web