diff options
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r-- | drivers/of/fdt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 3080d9dd031d..ce30c9a588a4 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -91,7 +91,7 @@ void of_fdt_limit_memory(int limit) * On match, returns a non-zero value with smaller values returned for more * specific compatible values. */ -int of_fdt_is_compatible(const void *blob, +static int of_fdt_is_compatible(const void *blob, unsigned long node, const char *compat) { const char *cp; @@ -507,6 +507,9 @@ void *__unflatten_device_tree(const void *blob, /* Allocate memory for the expanded device tree */ mem = dt_alloc(size + 4, __alignof__(struct device_node)); + if (!mem) + return NULL; + memset(mem, 0, size); *(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef); @@ -1050,7 +1053,7 @@ u64 __init dt_mem_next_cell(int s, const __be32 **cellp) } /** - * early_init_dt_scan_memory - Look for an parse memory nodes + * early_init_dt_scan_memory - Look for and parse memory nodes */ int __init early_init_dt_scan_memory(unsigned long node, const char *uname, int depth, void *data) |