diff options
author | 2022-11-14 17:18:33 +0800 | |
---|---|---|
committer | 2022-11-15 22:30:11 +0100 | |
commit | c55bfbb3ebce4e0956972f02b82673950ad1a2d2 (patch) | |
tree | abcf71fea4c1f6ab7fe5c3063edd5493a49b1ecf /kernel/events | |
parent | perf: Remove unused pointer task_ctx (diff) | |
download | linux-c55bfbb3ebce4e0956972f02b82673950ad1a2d2.tar.gz linux-c55bfbb3ebce4e0956972f02b82673950ad1a2d2.tar.bz2 linux-c55bfbb3ebce4e0956972f02b82673950ad1a2d2.zip |
perf: Fix IS_ERR() vs NULL check in inherit_event()
The find_get_pmu_context() returns an ERR_PTR() on failure, we should use
IS_ERR() to check the return value.
Fixes: bd2756811766 ("perf: Rewrite core context handling")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221114091833.1492575-1-cuigaosheng1@huawei.com
Diffstat (limited to 'kernel/events')
-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 baa2997578a5..baa6edf05031 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -13171,7 +13171,7 @@ inherit_event(struct perf_event *parent_event, return child_event; pmu_ctx = find_get_pmu_context(child_event->pmu, child_ctx, child_event); - if (!pmu_ctx) { + if (IS_ERR(pmu_ctx)) { free_event(child_event); return NULL; } |