Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm fix an integer promotion bug on 64 bit ports.



details:   https://anonhg.NetBSD.org/src/rev/d68fa05af226
branches:  trunk
changeset: 770315:d68fa05af226
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Oct 12 00:03:47 2011 +0000

description:
fix an integer promotion bug on 64 bit ports.
(signed + unsigned = unsigned)

diffstat:

 sys/uvm/uvm_mmap.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 4ced2c90650c -r d68fa05af226 sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c        Tue Oct 11 23:57:50 2011 +0000
+++ b/sys/uvm/uvm_mmap.c        Wed Oct 12 00:03:47 2011 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
                        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 */
                }



Home | Main Index | Thread Index | Old Index