All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Van Baren <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH: u-boot-fdt] Fix serious pointer bug with bootm and reserve map.
Date: Thu, 19 Apr 2007 23:42:23 -0400	[thread overview]
Message-ID: <20070420034223.GA7077@dellserver.lan> (raw)

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 <vanbaren@cideas.com>
---
 Makefile                    |    1 +
 board/mpc8360emds/config.mk |    5 -----
 common/fdt_support.c        |    4 ++--
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 9a27bc2..94cda54 100644
--- a/Makefile
+++ b/Makefile
@@ -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))
diff --git a/board/mpc8360emds/config.mk b/board/mpc8360emds/config.mk
index 5801a5f..9ace886 100644
--- a/board/mpc8360emds/config.mk
+++ b/board/mpc8360emds/config.mk
@@ -26,8 +26,3 @@
 #
 
 TEXT_BASE = 0xFE000000
-
-#
-# Additional board-specific libraries
-#
-BOARDLIBS = libfdt/libfdt.a
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 91b729f..69099c4 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -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;
 			}
 		}
-- 
1.4.4.4

                 reply	other threads:[~2007-04-20  3:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070420034223.GA7077@dellserver.lan \
    --to=gvb.uboot@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.