Fix serious pointer bug with bootm and reserve map.
PATCH 1/1 Fix serious pointer bug with bootm and reserve map.
What was suppose to be a stack variable was declared as a pointer,
overwriting random memory.
Also moved the libfdt.a requirement into the main Makefile. That is
The U-Boot Way.
Signed-off-by Gerald Van Baren <[email protected]>
--- Makefile | 1 + board/mpc8360emds/config.mk | 5 ----- common/fdt_support.c | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-)
Makefile +1 -0
@@ -219,6 +219,7 @@ LIBS += $(shell if [ -d post/cpu/$(CPU) ]; then echo \ LIBS += $(shell if [ -d post/board/$(BOARDDIR) ]; then echo \ "post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi) LIBS += common/libcommon.a +LIBS += libfdt/libfdt.a LIBS += $(BOARDLIBS) LIBS := $(addprefix $(obj),$(LIBS))
board/mpc8360emds/config.mk +0 -5
@@ -26,8 +26,3 @@ # TEXT_BASE = 0xFE000000 - -# -# Additional board-specific libraries -# -BOARDLIBS = libfdt/libfdt.a
common/fdt_support.c +2 -2
@@ -56,7 +56,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) }if (initrd_start && initrd_end) { -struct fdt_reserve_entry *re; +struct fdt_reserve_entry re;int used;int total;int j;
@@ -77,7 +77,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)*/ for (j =0 ; j < used; j++) { err =fdt_get_reservemap (fdt, j, &re); -if (re->address == initrd_start) { +if (re.address == initrd_start) {break ; } }
Signature · 1 line
1.4.4.4