summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2020-01-22 06:44:50 -0500
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-01-22 06:44:50 -0500
commit34423f250a372d71346922edf2b84a19d811a311 (patch)
treebe7232363c952d1b7ab9f1234c11c1b28ce6fea9 /kernel/trace/trace.c
parent532f49a6f19a153e202b5a174f8556fd50c36dd4 (diff)
downloadlinux-34423f250a372d71346922edf2b84a19d811a311.tar.bz2
tracing: Fix uninitialized buffer var on early exit to trace_vbprintk()
If we exit due to a bad input to trace_printk() (highly unlikely), then the buffer variable will not be initialized when we unnest the ring buffer. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2e1db19dce97..d1410b4462ac 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3230,7 +3230,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args)
len = vbin_printf((u32 *)tbuffer, TRACE_BUF_SIZE/sizeof(int), fmt, args);
if (len > TRACE_BUF_SIZE/sizeof(int) || len < 0)
- goto out;
+ goto out_put;
local_save_flags(flags);
size = sizeof(*entry) + sizeof(u32) * len;
@@ -3252,6 +3252,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args)
out:
ring_buffer_nest_end(buffer);
+out_put:
put_trace_buf();
out_nobuffer: