summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2017-02-06 10:32:40 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-02-06 10:32:40 +1100
commit234eceddc6f3853ac6d79621811057b9194ba443 (patch)
tree781dd5bb84cfc3e7e12e9b385a6e041dbb5b92d0 /drivers
parent9e8f5268e9642c8badd66842cff08e21a3054f58 (diff)
parent26eb4aa9a48a27b606e032948f1061d577589e92 (diff)
Merge remote-tracking branch 'mips/mips-for-linux-next'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/base.c2
-rw-r--r--drivers/of/fdt.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index a641b1faf057..a88387bc0ac1 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2113,7 +2113,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
continue;
/* Allocate an alias_prop with enough space for the stem */
- ap = dt_alloc(sizeof(*ap) + len + 1, 4);
+ ap = dt_alloc(sizeof(*ap) + len + 1, __alignof__(*ap));
if (!ap)
continue;
memset(ap, 0, sizeof(*ap) + len + 1);
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index c9b5cac03b36..82967b07f7be 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -738,9 +738,12 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
const char *pathp;
int offset, rc = 0, depth = -1;
- for (offset = fdt_next_node(blob, -1, &depth);
- offset >= 0 && depth >= 0 && !rc;
- offset = fdt_next_node(blob, offset, &depth)) {
+ if (!blob)
+ return 0;
+
+ for (offset = fdt_next_node(blob, -1, &depth);
+ offset >= 0 && depth >= 0 && !rc;
+ offset = fdt_next_node(blob, offset, &depth)) {
pathp = fdt_get_name(blob, offset, NULL);
if (*pathp == '/')