summaryrefslogtreecommitdiffstats
path: root/scripts/dtc/fstree.c
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-03-09 16:15:44 +0100
committerMichal Marek <mmarek@suse.cz>2011-03-09 16:15:44 +0100
commit2d8ad8719591fa803b0d589ed057fa46f49b7155 (patch)
tree4ae051577dad1161c91dafbf4207bb10a9dc91bb /scripts/dtc/fstree.c
parent9b4ce7bce5f30712fd926ab4599a803314a07719 (diff)
parentc56eb8fb6dccb83d9fe62fd4dc00c834de9bc470 (diff)
downloadlinux-2d8ad8719591fa803b0d589ed057fa46f49b7155.tar.gz
linux-2d8ad8719591fa803b0d589ed057fa46f49b7155.tar.bz2
linux-2d8ad8719591fa803b0d589ed057fa46f49b7155.zip
Merge commit 'v2.6.38-rc1' into kbuild/packaging
Diffstat (limited to 'scripts/dtc/fstree.c')
-rw-r--r--scripts/dtc/fstree.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/dtc/fstree.c b/scripts/dtc/fstree.c
index 766b2694d935..f3774530170a 100644
--- a/scripts/dtc/fstree.c
+++ b/scripts/dtc/fstree.c
@@ -58,10 +58,9 @@ static struct node *read_fstree(const char *dirname)
"WARNING: Cannot open %s: %s\n",
tmpnam, strerror(errno));
} else {
- prop = build_property(strdup(de->d_name),
+ prop = build_property(xstrdup(de->d_name),
data_copy_file(pfile,
- st.st_size),
- NULL);
+ st.st_size));
add_property(tree, prop);
fclose(pfile);
}
@@ -69,14 +68,14 @@ static struct node *read_fstree(const char *dirname)
struct node *newchild;
newchild = read_fstree(tmpnam);
- newchild = name_node(newchild, strdup(de->d_name),
- NULL);
+ newchild = name_node(newchild, xstrdup(de->d_name));
add_child(tree, newchild);
}
free(tmpnam);
}
+ closedir(d);
return tree;
}
@@ -85,8 +84,8 @@ struct boot_info *dt_from_fs(const char *dirname)
struct node *tree;
tree = read_fstree(dirname);
- tree = name_node(tree, "", NULL);
+ tree = name_node(tree, "");
- return build_boot_info(NULL, tree, 0);
+ return build_boot_info(NULL, tree, guess_boot_cpuid(tree));
}