]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Fix some alloc_event_probe() error handling bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 24 Aug 2021 11:51:50 +0000 (14:51 +0300)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 8 Sep 2021 00:58:23 +0000 (20:58 -0400)
commit8a6fac3c68718e72a40d64ce3f83db48f42efede
treebb792c38cf876d85e1561b1f04d3ed5f91b7e1cc
parent641e452151e8047bd5652ab9c3f312ad6c3b6190
tracing: Fix some alloc_event_probe() error handling bugs

There are two bugs in this code.  First, if the kzalloc() fails it leads
to a NULL dereference of "ep" on the next line.  Second, if the
alloc_event_probe() function returns an error then it leads to an
error pointer dereference in the caller.

Link: https://lkml.kernel.org/r/20210824115150.GI31143@kili
Fixes: 9ea3f95f94d9 ("tracing: Add a probe that attaches to trace events")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_eprobe.c