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 Ignore 0-sized memory regions in the FDT.



details:   https://anonhg.NetBSD.org/src/rev/e310e2b6c947
branches:  trunk
changeset: 826201:e310e2b6c947
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Aug 20 21:00:01 2017 +0000

description:
Ignore 0-sized memory regions in the FDT.

diffstat:

 sys/arch/evbarm/fdt/fdt_machdep.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 21576c66c267 -r e310e2b6c947 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Sun Aug 20 15:58:43 2017 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Sun Aug 20 21:00:01 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.11 2017/07/21 01:00:08 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.12 2017/08/20 21:00:01 jakllsch 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.11 2017/07/21 01:00:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.12 2017/08/20 21:00:01 jakllsch Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -235,7 +235,7 @@
        for (index = 0;
             fdtbus_get_reg64(memory, index, &addr, &size) == 0;
             index++) {
-               if (addr >= max_addr)
+               if (addr >= max_addr || size == 0)
                        continue;
                if (addr + size > max_addr)
                        size = max_addr - addr;



Home | Main Index | Thread Index | Old Index