tracing: Adding NULL checks for trace_array descriptor pointer
[ Upstream commit953ae45a0c] As part of commitf45d1225ad("tracing: Kernel access to Ftrace instances") we exported certain functions. Here, we are adding some additional NULL checks to ensure safe usage by users of these APIs. Link: http://lkml.kernel.org/r/1565805327-579-4-git-send-email-divya.indi@oracle.com Signed-off-by: Divya Indi <divya.indi@oracle.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8e0d54aa40
commit
9f81aa5d44
@@ -3233,6 +3233,9 @@ int trace_array_printk(struct trace_array *tr,
|
||||
if (!(global_trace.trace_flags & TRACE_ITER_PRINTK))
|
||||
return 0;
|
||||
|
||||
if (!tr)
|
||||
return -ENOENT;
|
||||
|
||||
va_start(ap, fmt);
|
||||
ret = trace_array_vprintk(tr, ip, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
Reference in New Issue
Block a user