summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorRob Herring2018-09-20 00:10:03 +0200
committerRob Herring2018-09-20 00:10:03 +0200
commit362ce2b8e52be97dcc3986ce6f8dbe9e7a84e1a0 (patch)
tree9085e2170a5ea1abc3d8ec369ef2dd20736ad41f /drivers/of
parentof: make default address and size cells sizes private (diff)
parentof: fix phandle cache creation for DTs with no phandles (diff)
downloadkernel-qcow2-linux-362ce2b8e52be97dcc3986ce6f8dbe9e7a84e1a0.tar.gz
kernel-qcow2-linux-362ce2b8e52be97dcc3986ce6f8dbe9e7a84e1a0.tar.xz
kernel-qcow2-linux-362ce2b8e52be97dcc3986ce6f8dbe9e7a84e1a0.zip
Merge branch 'dt/linus' into HEAD
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index a055cd1ef96d..17ae594b7014 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -140,6 +140,9 @@ void of_populate_phandle_cache(void)
if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL)
phandles++;
+ if (!phandles)
+ goto out;
+
cache_entries = roundup_pow_of_two(phandles);
phandle_cache_mask = cache_entries - 1;