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: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 532f49a6
...@@ -3230,7 +3230,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args) ...@@ -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); len = vbin_printf((u32 *)tbuffer, TRACE_BUF_SIZE/sizeof(int), fmt, args);
if (len > TRACE_BUF_SIZE/sizeof(int) || len < 0) if (len > TRACE_BUF_SIZE/sizeof(int) || len < 0)
goto out; goto out_put;
local_save_flags(flags); local_save_flags(flags);
size = sizeof(*entry) + sizeof(u32) * len; size = sizeof(*entry) + sizeof(u32) * len;
...@@ -3252,6 +3252,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args) ...@@ -3252,6 +3252,7 @@ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args)
out: out:
ring_buffer_nest_end(buffer); ring_buffer_nest_end(buffer);
out_put:
put_trace_buf(); put_trace_buf();
out_nobuffer: out_nobuffer:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment