Module Name: src
Committed By: ryo
Date: Thu Aug 4 11:58:55 UTC 2022
Modified Files:
src/sys/dev/fdt: fdt_memory.c
Log Message:
Don't pass a block of size 0 to fdt_memory_add_range().
There are some environments where size 0 blocks are passed from the loader.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/fdt/fdt_memory.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/fdt/fdt_memory.c
diff -u src/sys/dev/fdt/fdt_memory.c:1.4 src/sys/dev/fdt/fdt_memory.c:1.5
--- src/sys/dev/fdt/fdt_memory.c:1.4 Fri Jan 7 07:25:37 2022
+++ src/sys/dev/fdt/fdt_memory.c Thu Aug 4 11:58:55 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_memory.c,v 1.4 2022/01/07 07:25:37 mlelstv Exp $ */
+/* $NetBSD: fdt_memory.c,v 1.5 2022/08/04 11:58:55 ryo Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include "opt_fdt.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.4 2022/01/07 07:25:37 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_memory.c,v 1.5 2022/08/04 11:58:55 ryo Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -88,6 +88,8 @@ fdt_memory_get(uint64_t *pstart, uint64_
for (index = 0;
fdtbus_get_reg64(memory, index, &cur_addr, &cur_size) == 0;
index++) {
+ if (cur_size == 0)
+ continue;
fdt_memory_add_range(cur_addr, cur_size);
if (index == 0) {