diff options
author | Ravi Bangoria <ravi.bangoria@amd.com> | 2022-11-18 10:45:39 +0530 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-12-27 12:44:00 +0100 |
commit | e2d371484653ac83b970d3ebcf343383f39f8b6b (patch) | |
tree | 41b65d9809c9f301b249cd163e9f7f0e85dfd250 | |
parent | 1b929c02afd37871d5afb9d498426f83432e71c2 (diff) | |
download | linux-stable-e2d371484653ac83b970d3ebcf343383f39f8b6b.tar.gz linux-stable-e2d371484653ac83b970d3ebcf343383f39f8b6b.tar.bz2 linux-stable-e2d371484653ac83b970d3ebcf343383f39f8b6b.zip |
perf core: Return error pointer if inherit_event() fails to find pmu_ctx
inherit_event() returns NULL only when it finds orphaned events
otherwise it returns either valid child_event pointer or an error
pointer. Follow the same when it fails to find pmu_ctx.
Fixes: bd2756811766 ("perf: Rewrite core context handling")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221118051539.820-1-ravi.bangoria@amd.com
-rw-r--r-- | kernel/events/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index eacc3702654d..4bd2434251f0 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -13231,7 +13231,7 @@ inherit_event(struct perf_event *parent_event, pmu_ctx = find_get_pmu_context(child_event->pmu, child_ctx, child_event); if (IS_ERR(pmu_ctx)) { free_event(child_event); - return NULL; + return ERR_CAST(pmu_ctx); } child_event->pmu_ctx = pmu_ctx; |