From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Devicetree Compiler <devicetree-compiler@vger.kernel.org>
Subject: [PATCH 37/53] libfdt: Copy the struct region in fdt_resize()
Date: Sat, 20 Jul 2019 12:23:59 -0600 [thread overview]
Message-ID: <20190720182416.183626-38-sjg@chromium.org> (raw)
In-Reply-To: <20190720182416.183626-1-sjg@chromium.org>
At present this function appears to copy only the data before the struct
region and the data in the string region. It does not seem to copy the
struct region itself.
From the arguments of this function it seems that it should support fdt
and buf being different. This patch attempts to fix this problem.
Upstream commit: c72fa77 libfdt: Copy the struct region in fdt_resize()
Signed-off-by: Simon Glass <sjg@chromium.org>
---
scripts/dtc/libfdt/fdt_sw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/dtc/libfdt/fdt_sw.c b/scripts/dtc/libfdt/fdt_sw.c
index 6d33cc29d02..d8ef748a721 100644
--- a/scripts/dtc/libfdt/fdt_sw.c
+++ b/scripts/dtc/libfdt/fdt_sw.c
@@ -114,7 +114,7 @@ int fdt_resize(void *fdt, void *buf, int bufsize)
FDT_SW_CHECK_HEADER(fdt);
- headsize = fdt_off_dt_struct(fdt);
+ headsize = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
tailsize = fdt_size_dt_strings(fdt);
if ((headsize + tailsize) > bufsize)
--
2.22.0.657.g960e92d24f-goog
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot
next prev parent reply other threads:[~2019-07-20 18:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-20 18:23 [PATCH 00/53] binman: Support replacing entries in an existing image Simon Glass
2019-07-20 18:23 ` Simon Glass [this message]
2019-07-29 21:22 ` [PATCH 37/53] libfdt: Copy the struct region in fdt_resize() sjg
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=20190720182416.183626-38-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=devicetree-compiler@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).