lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <166859006717.4906.1082358264373442577.tip-bot2@tip-bot2>
Date:   Wed, 16 Nov 2022 09:14:27 -0000
From:   "tip-bot2 for Gaosheng Cui" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Gaosheng Cui <cuigaosheng1@...wei.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: perf/core] perf: Fix IS_ERR() vs NULL check in inherit_event()

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     c55bfbb3ebce4e0956972f02b82673950ad1a2d2
Gitweb:        https://git.kernel.org/tip/c55bfbb3ebce4e0956972f02b82673950ad1a2d2
Author:        Gaosheng Cui <cuigaosheng1@...wei.com>
AuthorDate:    Mon, 14 Nov 2022 17:18:33 +08:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Tue, 15 Nov 2022 22:30:11 +01:00

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@...wei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Link: https://lkml.kernel.org/r/20221114091833.1492575-1-cuigaosheng1@huawei.com
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index baa2997..baa6edf 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;
 	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ