Commit c55bfbb3 authored by Gaosheng Cui's avatar Gaosheng Cui Committed by Peter Zijlstra
Browse files

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: bd275681 ("perf: Rewrite core context handling")
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221114091833.1492575-1-cuigaosheng1@huawei.com
parent 3ce1cb7e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}