diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-03-14 13:30:50 +0900 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-03-14 19:54:21 -0400 |
commit | a039480e9e93896cadc5a91468964febb3c5d488 (patch) | |
tree | b0ae37b6ff3814566047f4cb8e5cac1d0738fc12 /kernel/trace/trace_uprobe.c | |
parent | 5b7a96220900e3c3f6fb53908eb4602cda959376 (diff) | |
download | linux-stable-a039480e9e93896cadc5a91468964febb3c5d488.tar.gz linux-stable-a039480e9e93896cadc5a91468964febb3c5d488.tar.bz2 linux-stable-a039480e9e93896cadc5a91468964febb3c5d488.zip |
tracing/probe: Verify alloc_trace_*probe() result
Since alloc_trace_*probe() returns -EINVAL only if !event && !group,
it should not happen in trace_*probe_create(). If we catch that case
there is a bug. So use WARN_ON_ONCE() instead of pr_info().
Link: http://lkml.kernel.org/r/155253785078.14922.16902223633734601469.stgit@devnote2
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_uprobe.c')
-rw-r--r-- | kernel/trace/trace_uprobe.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 52f033489377..b54137ec7810 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -514,8 +514,9 @@ static int trace_uprobe_create(int argc, const char **argv) tu = alloc_trace_uprobe(group, event, argc, is_return); if (IS_ERR(tu)) { - pr_info("Failed to allocate trace_uprobe.(%d)\n", (int)PTR_ERR(tu)); ret = PTR_ERR(tu); + /* This must return -ENOMEM otherwise there is a bug */ + WARN_ON_ONCE(ret != -ENOMEM); goto fail_address_parse; } tu->offset = offset; |