From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387454; b=fuPpBgVV3DW+vqtTYImcFQ+BVc+kbweHQqAZfIejT/JpOhZ/Y9M65pIDj0JpmvLYGKk/ 9lwHV7dvJrTqNQObOtS22Wemq2xN3NzG8mzQAI6D1EmUbYYpaQQzs4NYM47ufKjoyh1Kf Mo2pXx55IpOtMU58q20899Wym6OL8k9JmO/Di0ospxCqd27+u/aSXMUNCk3fjUup84MAl IGqK5xdPD54Blnxz+icfeC48PXFrwdCALxmVcbc/Yzb4yWLMywKsuWJ5yKfMzA7C2EoLg HVxVDKsGw1YKhevgOu5FGB8fnQd5PGpmP+ZJRnuRTDEodguEpDFQgSm0Xzimn1QEu9g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387454; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=bueFcjcRck4zUMiVsxXWPz4PW/Fz6uqRNhdXoSMkv1A=; b=Hvc9IPsIsFZOYTGReu/vFxTPIMlIhJcIeapeZYoKo+dD33rm8VTkSJq6XUF92ucqPLzQ JNuq1glh3/U2LljD0qJeldsutC37jbkcyFjpeprn3rvoJ+hUqyGWBmYkSQL614CKQLGOJ +NuZRDX7PKheke3g4kd/MX7SsZULAB7D/KhJ1JJLGUD/tTfFb0+gwjRNZw7wgx20fPntV iLgoKOz/gxdg9A3GQyJISnwwg+hFTI0y3muPR+Ns1I7tMnNCVooFaA0zRYdNmXNa9234L 5NCrWErk5diT/0k24GJvjCC37je9c/YyeMOgzJPaOYY67fyz1XxRWKhkw0MP004YSxA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ERRReNrt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4878C606A32C; Fri, 4 Dec 2026 12:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ERRReNrt Received: by smtp.kernel.org (Postfix) with ESMTPSA id B72F91F000C2; Fri, 4 Dec 2026 12:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387454; bh=bueFcjcRck4zUMiVsxXWPz4PW/Fz6uqRNhdXoSMkv1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ERRReNrt4YjMurgR+/fr+pfxONmuO057BJTHQnHVZptaL/LYMKFpz5ZdIdo9bZNlz KojS3zdg2JAvRJVYMvLRZbvS5GR6pw4/ESzuRnsYN/SKQe5vhK80ZFTFkwBg83ItlM 5s+wvxINXoxSrLe0hWqcgZLUp7YjAASAqzRYdCZo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, sashiko-bot , Ian Rogers , Stephane Eranian , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 6.1 0250/1059] perf jitdump: Free event in jit_repipe_code_move() Date: Fri, 4 Dec 2026 18:56:21 +0900 Message-ID: <20261204100650.746264902@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnaldo Carvalho de Melo [ Upstream commit 7fc5851aac606b9e4143f6857710cc5f346770c5 ] jit_repipe_code_move() allocates a perf_event with calloc but never frees it — the 'out' label exits with only perf_sample__exit(). The sibling function jit_repipe_code_load() correctly calls free(event) at its out label. Add the same free(event) to jit_repipe_code_move(). Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support") Reported-by: sashiko-bot Reviewed-by: Ian Rogers Cc: Stephane Eranian Assisted-by: LLM Signed-off-by: Arnaldo Carvalho de Melo [ sashal: Added an out: label with free(event) to the older function layout, and changed the mmap2 failure return into goto out, since perf_sample__exit() and the upstream label are absent. ] Signed-off-by: Sasha Levin --- tools/perf/util/jitdump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 04e648cdab89f..d3ffe5eb55f01 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c @@ -665,12 +665,13 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr) ret = perf_event__process_mmap2(tool, event, &sample, jd->machine); if (ret) - return ret; + goto out; ret = jit_inject_event(jd, event); if (!ret) build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine); - +out: + free(event); return ret; } -- 2.53.0