aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/fdtdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 9ecfa2a..460f0d2 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1311,7 +1311,8 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename,
continue;
}
- if (addr == carveout->start && (addr + size) == carveout->end) {
+ if (addr == carveout->start && (addr + size - 1) ==
+ carveout->end) {
if (phandlep)
*phandlep = fdt_get_phandle(blob, node);
return 0;