[Skiboot] [PATCH v2 3/6] fdt: check more errors
Nicholas Piggin
npiggin at gmail.com
Thu May 2 21:15:12 AEST 2019
This catches a few more error cases in fdt building.
---
core/fdt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/core/fdt.c b/core/fdt.c
index ce4f66380..da5cc58d9 100644
--- a/core/fdt.c
+++ b/core/fdt.c
@@ -167,16 +167,20 @@ static int __create_dtb(void *fdt, size_t len,
const struct dt_node *root,
bool exclusive)
{
- fdt_create(fdt, len);
+ save_err(fdt_create(fdt, len));
+ if (fdt_error)
+ goto err;
+
if (root == dt_root && !exclusive)
create_dtb_reservemap(fdt, root);
else
- fdt_finish_reservemap(fdt);
+ save_err(fdt_finish_reservemap(fdt));
flatten_dt_node(fdt, root, exclusive);
save_err(fdt_finish(fdt));
if (fdt_error) {
+err:
prerror("dtb: error %s\n", fdt_strerror(fdt_error));
return fdt_error;
}
--
2.20.1
More information about the Skiboot
mailing list