From ce6b27a874fe30e7126ae93c060277770ee85ced Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Mon, 28 Mar 2011 09:58:55 +0000 Subject: Fix off-by-one error in passing initrd end address via device tree The initrd_end variable contains the address immediately *after* the initrd blob, not the last address containing data. This patch fixes an inadvertent off-by-one when setting up the initrd reserved map. Signed-off-by: Grant Likely --- common/fdt_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index edcf04a..496040b 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -183,7 +183,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) } } - err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start + 1); + err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start); if (err < 0) { printf("fdt_initrd: %s\n", fdt_strerror(err)); return err; -- cgit v1.1