The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d355a5e6194be4c3f7dcba237ea4cedb5c92bde8
commit d355a5e6194be4c3f7dcba237ea4cedb5c92bde8 Author: Warner Losh <i...@freebsd.org> AuthorDate: 2025-08-26 02:07:38 +0000 Commit: Warner Losh <i...@freebsd.org> 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); }