From 7562b35b234b0c219cd2153547262aed851aedbd Mon Sep 17 00:00:00 2001 From: dougm Date: Mon, 10 Jun 2019 22:06:40 +0000 Subject: [PATCH] r348879 introduced a wrong-way comparison that broke mmap. This change rights that comparison. Reported by: pho Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20595 --- sys/vm/vm_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 4b4382e875e..cd483527af7 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -259,7 +259,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t len, int prot, int flags, size = len + pageoff; /* low end... */ size = round_page(size); /* hi end */ /* Check for rounding up to zero. */ - if (len < size) + if (len > size) return (ENOMEM); /* Ensure alignment is at least a page and fits in a pointer. */ -- 2.45.0