diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-19 15:03:24 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-19 15:03:24 -0700 |
commit | 1fbbed4137de93e02fc62776b8bf08a2d9ae1141 (patch) | |
tree | 1a50291637d723e1a49eed91d5d15d22452750c4 /drivers | |
parent | f538a82c075ba3d31e7691a361f28795eff0a786 (diff) | |
parent | 49e67dd17649b60b4d54966e18ec9c80198227f0 (diff) | |
download | linux-1fbbed4137de93e02fc62776b8bf08a2d9ae1141.tar.bz2 |
Merge tag 'devicetree-fixes-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree fixes from Rob Herring:
- fix missing allocation failure handling in fdt code
- fix dtc compile error on 32-bit hosts
- revert bad sparse changes causing GCC7 warnings
* tag 'devicetree-fixes-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of: fdt: add missing allocation-failure check
dtc: check.c fix compile error
Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code"
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/of/fdt.c | 3 | ||||
-rw-r--r-- | drivers/of/of_reserved_mem.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 3080d9dd031d..43bd69dceabf 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -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); diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 4dec07ea510f..d507c3569a88 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -197,7 +197,7 @@ static int __init __reserved_mem_init_node(struct reserved_mem *rmem) const struct of_device_id *i; for (i = __reservedmem_of_table; i < &__rmem_of_table_sentinel; i++) { - int const (*initfn)(struct reserved_mem *rmem) = i->data; + reservedmem_of_init_fn initfn = i->data; const char *compat = i->compatible; if (!of_flat_dt_is_compatible(rmem->fdt_node, compat)) |