Patch "tracing: Missing error code in tracer_alloc_buffers()" has been added to the 4.12-stable tree

gregkh
2017-08-27T12:55:27Z

This is a note to let you know that I've just added the patch titled

tracing: Missing error code in tracer_alloc_buffers()

to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
tracing-missing-error-code-in-tracer_alloc_buffers.patch
and it can be found in the queue-4.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.

>From 147d88e0b5eb90191bc5c12ca0a3c410b75a13d2 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 1 Aug 2017 14:02:01 +0300
Subject: tracing: Missing error code in tracer_alloc_buffers()

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 147d88e0b5eb90191bc5c12ca0a3c410b75a13d2 upstream.

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>
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
kernel/trace/trace.c | 1 +
1 file changed, 1 insertion(+)

--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8110,6 +8110,7 @@ __init static int tracer_alloc_buffers(v
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;

Patches currently in stable-queue which might be from dan.carpenter@oracle.com are

queue-4.12/tracing-missing-error-code-in-tracer_alloc_buffers.patch
queue-4.12/mm-shmem-fix-handling-sys-kernel-mm-transparent_hugepage-shmem_enabled.patch