From 4e27ff24fcbc9f268b65fb80ffe2d340c350cec6 Mon Sep 17 00:00:00 2001 From: yamt Date: Wed, 12 Oct 2011 00:03:47 +0000 Subject: [PATCH] fix an integer promotion bug on 64 bit ports. (signed + unsigned = unsigned) --- sys/uvm/uvm_mmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index 5a5ce5ef3444..86d0918981cf 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_mmap.c,v 1.137 2011/06/23 23:42:44 matt Exp $ */ +/* $NetBSD: uvm_mmap.c,v 1.138 2011/10/12 00:03:47 yamt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.137 2011/06/23 23:42:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.138 2011/10/12 00:03:47 yamt Exp $"); #include "opt_compat_netbsd.h" #include "opt_pax.h" @@ -395,7 +395,7 @@ sys_mmap(struct lwp *l, const struct sys_mmap_args *uap, register_t *retval) fd_putfile(fd); return (EINVAL); } - if (vp->v_type != VCHR && (pos + size) < pos) { + if (vp->v_type != VCHR && (off_t)(pos + size) < pos) { fd_putfile(fd); return (EOVERFLOW); /* no offset wrapping */ }