提交 211cfa50 编写于 作者: S Simon Glass

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: NSimon Glass <sjg@chromium.org>
上级 e9d336d8
......@@ -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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册