Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbarm/fdt Fix off-by-one in nfdt_physmem KASSERT, ...
details: https://anonhg.NetBSD.org/src/rev/0dda38f61bbc
branches: trunk
changeset: 828414:0dda38f61bbc
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Wed Dec 13 00:22:24 2017 +0000
description:
Fix off-by-one in nfdt_physmem KASSERT, and while here bump MAX_PHYSMEM
from 4 to 16.
diffstat:
sys/arch/evbarm/fdt/fdt_machdep.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r e52198d59eeb -r 0dda38f61bbc sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Tue Dec 12 21:00:28 2017 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Wed Dec 13 00:22:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.16 2017/12/10 21:38:27 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.17 2017/12/13 00:22:24 jmcneill Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.16 2017/12/10 21:38:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.17 2017/12/13 00:22:24 jmcneill Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@@ -446,7 +446,7 @@
parse_mi_bootargs(boot_args);
- #define MAX_PHYSMEM 4
+ #define MAX_PHYSMEM 16
static struct boot_physmem fdt_physmem[MAX_PHYSMEM];
int nfdt_physmem = 0;
struct extent_region *er;
@@ -455,7 +455,7 @@
DPRINTF(" %lx - %lx\n", er->er_start, er->er_end);
struct boot_physmem *bp = &fdt_physmem[nfdt_physmem++];
- KASSERT(nfdt_physmem < MAX_PHYSMEM);
+ KASSERT(nfdt_physmem <= MAX_PHYSMEM);
bp->bp_start = atop(er->er_start);
bp->bp_pages = atop(er->er_end - er->er_start);
bp->bp_freelist = VM_FREELIST_DEFAULT;
Home |
Main Index |
Thread Index |
Old Index