]> git.sur5r.net Git - u-boot/commitdiff
Fix off-by-one error in passing initrd end address via device tree
authorGrant Likely <grant.likely@linaro.org>
Mon, 28 Mar 2011 09:58:55 +0000 (09:58 +0000)
committerGerald Van Baren <gvb@unssw.com>
Tue, 26 Apr 2011 01:11:21 +0000 (21:11 -0400)
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 <grant.likely@linaro.org>
common/fdt_support.c

index edcf04a21b7353b494e418de0deadd1e54aeeb7e..496040b54c8daf0188eef1f8680d3ac45809d9ad 100644 (file)
@@ -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;