From patchwork Tue Dec 27 11:51:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 36832 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1353061wrt; Tue, 27 Dec 2022 03:56:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXtQQ7VFW5BC0UqDq3tnGZnMKRV0J4SrtgTj6sgbnPbSRBj9P8mw0GM07kVTkjR5emg/mlws X-Received: by 2002:a17:906:bc1:b0:7fd:eb9e:6fd5 with SMTP id y1-20020a1709060bc100b007fdeb9e6fd5mr17443292ejg.45.1672142174936; Tue, 27 Dec 2022 03:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672142174; cv=none; d=google.com; s=arc-20160816; b=RTyK+JDhlIEaGQLGxJ/uJR/qTR0pPu/hwqdytRK9DTnskPyo6F2v0UKG1ckcBfiFBO M8n5+3nKj1lGkp2LH71cuD48qc6ZgZaPk+unfTj64ze9OjWQFTivb7TnORr/iNA1rzaT 9IpYvzu9PANc5MEM2u//FESENtMIif1E0BTAcT8lHnWvFtxnd8bYhdhBQJV30jTvtfWg LhdmwSH48G8A0jtbFWl3dq5S6i17xFY3D961O2WBfZae2q0KbeuQvuvqA1EG4HJvzHli 0MNukz02CIvTduNYpinxwgeLTOqQuLOGh7osVYyDcCFKoaoJ5ZYjPVnUmTSEe31/29Ca bQTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=H8Oc708uuNRJS/NyoKOl+HJ3muQJ2uYIQmtF0Hxiq/c=; b=fKBDIUyqDFUqh+jgLDFpsz9hxtLEjNQf35QHJeLjZ75R+fg34/MkSk+4LMcQ6o8wHj HV0GwIVppewwJT8Lf/fZPXGcGtp1iyPYllmLGinborPADOixutCk3YyATuuM36g5zqZW xo3tqkzTPjJyQfM4/YjVvUVdLeybpOeu1sOz7zBY/JIIa/V96DuQNU8CCMyMZjnmUdeS 1hY8DuwX9dc7KJI9v9PNLEYSsczx12g1LfqMk9KGZIOsNoy+M63eDQwXGAuDwjUb4BLR 3IgVBwKNwAKlUVW7Xwg1x6CiEFxweJZ7t1oceGIZqwRpnre6XMWpQXK0z6w5IlCBe+jk gMjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PgWXviF3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd11-20020a170907628b00b0083a60c1d7besi10597984ejc.109.2022.12.27.03.55.51; Tue, 27 Dec 2022 03:56:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PgWXviF3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231543AbiL0Lvh (ORCPT + 99 others); Tue, 27 Dec 2022 06:51:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbiL0Lv2 (ORCPT ); Tue, 27 Dec 2022 06:51:28 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC8CB767C; Tue, 27 Dec 2022 03:51:26 -0800 (PST) Date: Tue, 27 Dec 2022 11:51:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672141884; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H8Oc708uuNRJS/NyoKOl+HJ3muQJ2uYIQmtF0Hxiq/c=; b=PgWXviF3Hs9/TjIash8+QSGCcK5LDpOEiMzxD7nqzQtb5UUjqYKkYnoFg3+NDyrRKS/vyL qmHDt4T7RT5SmSns/x9WnsAt94X6fKAG6VKZTIMjtjvcglPErReAESIwYY+fnjazYO+PfK bt/VZR2VaMdupnWNdZrRr3Y7B9Bz2pvjN9q6dXWDh0XxHWMWq6S9GdRygSgf4+aJ3n0r+u lzCTNFLTvT2+wXzJhG7EvxTItsUjGSO3/WDX3OV4rrB95AgcxwbywiDH6CQ9C0M6jnm8LN 5dma7DJsHKMpuO4aT2L1CWFZUwXU7H+F2369WDU57+sCKTEzTHQCivri7FILgQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672141884; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H8Oc708uuNRJS/NyoKOl+HJ3muQJ2uYIQmtF0Hxiq/c=; b=L6keM0ofsj9qqSg7hCLJ2Fft5nMhufkwI5Z9Oz/91VIvRuSLCoSWgeoGpKNWo9tu+ZGhaO Od32EjriSmsWXnAQ== From: "tip-bot2 for Ravi Bangoria" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf core: Return error pointer if inherit_event() fails to find pmu_ctx Cc: Dan Carpenter , Ravi Bangoria , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221118051539.820-1-ravi.bangoria@amd.com> References: <20221118051539.820-1-ravi.bangoria@amd.com> MIME-Version: 1.0 Message-ID: <167214188410.4906.8195204511062431247.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749809844414361554?= X-GMAIL-MSGID: =?utf-8?q?1753368153036525133?= The following commit has been merged into the perf/urgent branch of tip: Commit-ID: e2d371484653ac83b970d3ebcf343383f39f8b6b Gitweb: https://git.kernel.org/tip/e2d371484653ac83b970d3ebcf343383f39f8b6b Author: Ravi Bangoria AuthorDate: Fri, 18 Nov 2022 10:45:39 +05:30 Committer: Peter Zijlstra CommitterDate: Tue, 27 Dec 2022 12:44:00 +01:00 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 Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20221118051539.820-1-ravi.bangoria@amd.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 eacc370..4bd2434 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;