From nobody Fri Nov 06 15:22:35 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jLjbb49Bfz6yWFR for ; Fri, 06 Nov 2026 15:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jLjbb3GYVz4Z4V for ; Fri, 06 Nov 2026 15:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793978555; h=from:from: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; bh=Q6DfyMByfBEwodL2++qg0jEoyPjAiTEv1MgRaZHatFo=; b=rxPReDXRTMVO/J80/JGJr6Mnzpp5j77h5pcx7rcf9vmnEdO7dU/mV7AKjJrudAiYZ51mSo A4aj3mmyqwwnc8+p/q5tSwDa4UlwJo2KGUZMmZ3Dbj4Rxxwq2/aGmF5taCEcQFTybjjNEk RunAHaQWS/b/ESzbhqBEbM+/GIURjJPJ411WfYyvxcpDWi4IGEZFGDE1EGEFHX193XSd6T KK1iFl70J9OrNaCYvfBhumOYVk+MN6JHC7Q21/AeczKkacHGf0d9J6nO9WK/o68i9ea9M+ 1+freQfvICCxiSZg9gmJkeiSgMuKjsXWDdivKNrNXcC9a0+maJrx/cMHfyJsJg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793978555; b=EwnL4CnlBkJsLJ680bBe/OjRSoaPtyOGFyA+huLFn3Mx7t0vLrli2xLaowQawJ/zA91y0a BgQA7otL1zik3L4EkV2Md32BEU0SIMUvgmi5NBzZ1WcFD9KKgOEtg53L1kXfE1w3nqwbO/ YrAEZ5BeHyIAvHqMXO4NC337G94QdYA2yqu2WUQJXjW4gwDl6J06AdAx6tNxRDCLk7VwxH ZCnSuPdWyrBKpUztJoqWWrt82vCSBuAb/cwiujirNxcd9SPVMLf8V1F+lAw19sE8UI5TR+ Tn/wXKF0SdQKK1LsgIT+B+YBXANRDPd/RyTQ57ePvoveFe3fJ35XgwNpCYDjvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793978555; h=from:from: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; bh=Q6DfyMByfBEwodL2++qg0jEoyPjAiTEv1MgRaZHatFo=; b=vxn2lQNmvKgNKCqiCeONrTLY0S4wRxETQFrsdmrVCkL5pZ4LfdNJcEi3ERfPaaCE2o+QCd SmR915XAf2+iO9ZOPYWVrd8tWYtEy3a8BTXEG+DUIwl8EQnLOYdwrxX6na9z7f0mL15rlp uFOUbcmAdRDV/9l9nOo+OfXOh4wfdrxk+5PlkWwvF0EuBzjyJSiBHsmofxTTlAxmgnDdoK gvHjfXtEKLZi/BnQ8FtOJGACm6MxLpOmG3n32qiQsrm72Ysz+6MKXH3909rvKZaCBW6HoK AEOGHJIzte0l7NsOlNhgcX1lME5zvkrrmVZY0+JDxhgafMMRW6Q13Yb0lDE8+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jLjbb2vxZzk3S for ; Fri, 06 Nov 2026 15:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30f23 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 06 Nov 2026 15:22:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Andre Silva From: Mitchell Horne Subject: git: e5a48c8e0dd0 - main - hwpmc: release a PMC whose ID could not be copied out List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository 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 X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5a48c8e0dd026ba953cf401c4dec02f76078aa2 Auto-Submitted: auto-generated Date: Fri, 06 Nov 2026 15:22:35 +0000 Message-Id: <6aedf0bb.30f23.44a9a63d@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e5a48c8e0dd026ba953cf401c4dec02f76078aa2 commit e5a48c8e0dd026ba953cf401c4dec02f76078aa2 Author: Andre Silva AuthorDate: 2026-11-06 15:20:08 +0000 Commit: Mitchell Horne CommitDate: 2026-11-06 15:21:45 +0000 hwpmc: release a PMC whose ID could not be copied out If copyout of the newly allocated PMC ID fails, the caller cannot use or release the PMC. Release it in the kernel. Reviewed by: mhorne MFC after: 3 days Sponsored by: Advanced Micro Devices, Inc. Differential Revision: https://reviews.freebsd.org/D60562 --- sys/dev/hwpmc/hwpmc_mod.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 7ffabee4004f..82079e7660ea 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -4367,6 +4367,12 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) break; error = copyout(&pa, arg, sizeof(pa)); + /* + * The caller never learns the ID of an unpublished PMC; do + * not leave it (and the row it holds) behind. + */ + if (error != 0) + (void)pmc_do_op_pmcrelease(pa.pm_pmcid); } break;