aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dtc/fstree.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dtc/fstree.c')
-rw-r--r--scripts/dtc/fstree.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/dtc/fstree.c b/scripts/dtc/fstree.c
index 8fe1bdf239f0..f3774530170a 100644
--- a/scripts/dtc/fstree.c
+++ b/scripts/dtc/fstree.c
@@ -58,10 +58,9 @@ static struct node *read_fstree(const char *dirname)
58 "WARNING: Cannot open %s: %s\n", 58 "WARNING: Cannot open %s: %s\n",
59 tmpnam, strerror(errno)); 59 tmpnam, strerror(errno));
60 } else { 60 } else {
61 prop = build_property(strdup(de->d_name), 61 prop = build_property(xstrdup(de->d_name),
62 data_copy_file(pfile, 62 data_copy_file(pfile,
63 st.st_size), 63 st.st_size));
64 NULL);
65 add_property(tree, prop); 64 add_property(tree, prop);
66 fclose(pfile); 65 fclose(pfile);
67 } 66 }
@@ -69,8 +68,7 @@ static struct node *read_fstree(const char *dirname)
69 struct node *newchild; 68 struct node *newchild;
70 69
71 newchild = read_fstree(tmpnam); 70 newchild = read_fstree(tmpnam);
72 newchild = name_node(newchild, strdup(de->d_name), 71 newchild = name_node(newchild, xstrdup(de->d_name));
73 NULL);
74 add_child(tree, newchild); 72 add_child(tree, newchild);
75 } 73 }
76 74
@@ -86,8 +84,8 @@ struct boot_info *dt_from_fs(const char *dirname)
86 struct node *tree; 84 struct node *tree;
87 85
88 tree = read_fstree(dirname); 86 tree = read_fstree(dirname);
89 tree = name_node(tree, "", NULL); 87 tree = name_node(tree, "");
90 88
91 return build_boot_info(NULL, tree, 0); 89 return build_boot_info(NULL, tree, guess_boot_cpuid(tree));
92} 90}
93 91