Message ID | 20180911145607.6009-1-robh@kernel.org |
---|---|
State | Accepted |
Commit | e54192b48da75f025ae4b277925eaf6aca1d13bd |
Headers | show |
Series | of: fix phandle cache creation for DTs with no phandles | expand |
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;