Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/stand/ofwboot Fix available length calculatio...



details:   https://anonhg.NetBSD.org/src/rev/3a23ffe184a7
branches:  trunk
changeset: 338885:3a23ffe184a7
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jun 14 16:20:44 2015 +0000

description:
Fix available length calculation in kvamap_extract when reusing existing
mappings.

diffstat:

 sys/arch/sparc/stand/ofwboot/loadfile_machdep.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r 59be074e437c -r 3a23ffe184a7 sys/arch/sparc/stand/ofwboot/loadfile_machdep.c
--- a/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c   Sun Jun 14 16:19:31 2015 +0000
+++ b/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c   Sun Jun 14 16:20:44 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: loadfile_machdep.c,v 1.13 2014/04/21 18:10:40 palle Exp $      */
+/*     $NetBSD: loadfile_machdep.c,v 1.14 2015/06/14 16:20:44 martin Exp $     */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -136,13 +136,13 @@
                if (kvamap[i].start == NULL)
                        break;
                if ((kvamap[i].start <= va) && (va < kvamap[i].end)) {
-                       uint64_t va_len = kvamap[i].end - va + kvamap[i].start;
+                       uint64_t va_len = kvamap[i].end - va;
                        len = (va_len < len) ? len - va_len : 0;
                        *new_va = kvamap[i].end;
                }
        }
 
-       return (len);
+       return len;
 }
 
 /*



Home | Main Index | Thread Index | Old Index