mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/2] bootm: fix printing kernel command line
Date: Thu, 21 Sep 2023 13:04:57 +0200	[thread overview]
Message-ID: <20230921110457.3848170-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230921110457.3848170-1-s.hauer@pengutronix.de>

Since af084cae41ce ("of: never fixup internal live tree")
of_get_fixed_tree() no longer fixes the tree passed into the function, but a copy thereof
instead. in bootm this has the side effect that data->of_root_node
will no longer contain a fixed tree, but the original tree instead.
data->of_root_node is used later for printing the kernel command line
and it's also printed with bootm -vv, so this pointer should really
hold a fixed tree.
Fix this by not using of_get_fixed_tree() but open coding it.

Fixes: af084cae41ce ("of: never fixup internal live tree")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/bootm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/bootm.c b/common/bootm.c
index 27ada61f4e..2469d43441 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -421,7 +421,9 @@ void *bootm_get_devicetree(struct image_data *data)
 		of_add_reserve_entry(data->initrd_res->start, data->initrd_res->end);
 	}
 
-	oftree = of_get_fixed_tree(data->of_root_node);
+	of_fix_tree(data->of_root_node);
+
+	oftree = of_flatten_dtb(data->of_root_node);
 	if (!oftree)
 		return ERR_PTR(-EINVAL);
 
-- 
2.39.2




      reply	other threads:[~2023-09-21 11:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 11:04 [PATCH 1/2] bootm: always put a copy into data->of_root_node Sascha Hauer
2023-09-21 11:04 ` Sascha Hauer [this message]

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=20230921110457.3848170-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox