From nobody Tue Aug 26 02:14:58 2025 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 4c9rpV29WFz662kk; Tue, 26 Aug 2025 02:14:58 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c9rpV1kKrz41CX; Tue, 26 Aug 2025 02:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756174498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G5eOhwp7q6dmg+esRs2bcQPq06QrWCzVQWHK974lJJE=; b=wBtOuSxp0AqiKjadj37xKcg/jU0z+HOMQfUcuw2HHwBQpFTDmzeO3IGEQd/eNac+hC6Qx3 m2rO5tN4BJu11II7pkumQQGyHvXVJPvgHJMVt+CKcWe09n7g2l2zszcWeUf4Q9GlzH9L/z F0krTZkh5pL884gC8QTFMVnhwYH2ntBIb85F4G4p8qZU2QFqRbLiBM/dZXU9VP+p2Qelth UaQZGNTJ1RfLJtxARSIgvdZa54U3G/Fsi3ifz8a0umg0Jx9Ez8x5AD4aM2RANTLV3ySlaT 0orH5CLCh8EVCMXegVn15GrAVlE75Tc/bVbhvtIzSgx+HLy+GFZsmubUtgnHRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756174498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G5eOhwp7q6dmg+esRs2bcQPq06QrWCzVQWHK974lJJE=; b=w+UIwsWg+DnAxPfWZ5AF81Bz0jx2/2V3G9fPKlxG2MP09OVrbYFfU/BsTumLOZLwNI8C21 KucBBqZ1+01i1kneI5GAm3CTco4/0k5fdTAF+oBYeJMrzIpU4+2yIxeChaaIgAndcyWcKp fC9t0hck9HfBvrVjDLG26WJmCW1azhme6x9ml6YgkK8q2Wh02YUp7DpfDpwu0V/4X2JpBC 2hFas+K9Ych6xsgZ6+LpATuulOl5ujTdGBeqxWySPql7A4MqPWejKIqKGGolgIftYJNh/3 WO++uRsYRYPa5qToFPSIgFZv0UpmLSV6jLVejLk5swAYUiCJIYwTsbdDRBoI4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756174498; a=rsa-sha256; cv=none; b=E+MEBMyiGpKH8lQFVJM3gbr4Zm/xhbQcrU0TehBr64fIFX6bJvAr+J7VV9rd9iAe6fDX2h J/MqfIhTopPGqzwwdtoX44OyjVqL0L/nMumDx9ZpW/PoDuFIg9uxyEl9MEQ1VJi5uOQV0+ kFlJqhzFSBFDqCdIlWxoDWHacke0/LPdDfWDM4Bku8XQzVA30zM6BGsXjmQ6QliAedGs0u Dbt5jfCG+ZiPRTrDVTq+Rc3jwE6RFaK7aH2I++oHlKbG62bbfM5Pk/W6gLvcvln2AduZDD GlTYHeaqKMseuespbD00emDhwpY+j2LUD+S1rRU1gfawVCm49INEJ9ZK2nVIPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4c9rpV145wz1k6; Tue, 26 Aug 2025 02:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57Q2Ewjv076436; Tue, 26 Aug 2025 02:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57Q2Ew7J076433; Tue, 26 Aug 2025 02:14:58 GMT (envelope-from git) Date: Tue, 26 Aug 2025 02:14:58 GMT Message-Id: <202508260214.57Q2Ew7J076433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d355a5e6194b - main - vchiq_arm: Don't free on error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d355a5e6194be4c3f7dcba237ea4cedb5c92bde8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d355a5e6194be4c3f7dcba237ea4cedb5c92bde8 commit d355a5e6194be4c3f7dcba237ea4cedb5c92bde8 Author: Warner Losh AuthorDate: 2025-08-26 02:07:38 +0000 Commit: Warner Losh CommitDate: 2025-08-26 02:15:07 +0000 vchiq_arm: Don't free on error When actual_pages is -1, calling vm_page_unhold_pages will loop forever. We don't actually need to loop. In fact, it will either be -1 or the right number of pages: we never return a partial allocation. It might be more proper to assert this, but since this is contrib code, make a minimal change to avoid the infinite loop. Sponsored by: Netflix Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D52154 --- sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c index ab8981e25cb2..0150ce72f0a4 100644 --- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c +++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c @@ -464,7 +464,8 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, (type == PAGELIST_READ ? VM_PROT_WRITE : 0 ) | VM_PROT_READ, pages, num_pages); if (actual_pages != num_pages) { - vm_page_unhold_pages(pages, actual_pages); + if (actual_pages > 0) + vm_page_unhold_pages(pages, actual_pages); free(pagelist, M_VCPAGELIST); return (-ENOMEM); }