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


Groups > linux.kernel > #1700867 > unrolled thread

[PATCH] tracing: missing error code in tracer_alloc_buffers()

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2017-08-01 13:10 +0200
Last post2017-08-01 13:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] tracing: missing error code in tracer_alloc_buffers() Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-01 13:10 +0200

#1700867 — [PATCH] tracing: missing error code in tracer_alloc_buffers()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-08-01 13:10 +0200
Subject[PATCH] tracing: missing error code in tracer_alloc_buffers()
Message-ID<u9DdL-3gc-7@gated-at.bofh.it>
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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 42b9355033d4..625c00aab800 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;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web