summaryrefslogtreecommitdiff
path: root/scripts/dtc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-09-01 05:13:56 -0600
committerSimon Glass <sjg@chromium.org>2020-09-22 12:50:43 -0600
commit211cfa503f6cf850ccbd79b1082f9234b603e635 (patch)
tree05db6af17902e2f863f340c8404c7d5342867a19 /scripts/dtc
parente9d336d866cd5ab943f8ec00775a413a847c4960 (diff)
downloadu-boot-211cfa503f6cf850ccbd79b1082f9234b603e635.tar.gz
u-boot-211cfa503f6cf850ccbd79b1082f9234b603e635.tar.bz2
u-boot-211cfa503f6cf850ccbd79b1082f9234b603e635.zip
libfdt: Detected out-of-space with fdt_finish()
At present the Python sequential-write interface can produce an error when it calls fdt_finish(), since this needs to add a terminating tag to the end of the struct section. Fix this by automatically expanding the buffer if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'scripts/dtc')
-rw-r--r--scripts/dtc/pylibfdt/libfdt.i_shipped3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
index fae0b27d7d..1d69ad38e2 100644
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -786,7 +786,8 @@ class FdtSw(FdtRo):
Fdt object allowing access to the newly created device tree
"""
fdtsw = bytearray(self._fdt)
- check_err(fdt_finish(fdtsw))
+ while self.check_space(fdt_finish(fdtsw)):
+ fdtsw = bytearray(self._fdt)
return Fdt(fdtsw)
def check_space(self, val):