projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2051d6
)
of: Don't try to search when phandle == 0
author
Grant Likely
<grant.likely@linaro.org>
Thu, 2 Oct 2014 12:08:02 +0000
(13:08 +0100)
committer
Grant Likely
<grant.likely@linaro.org>
Sat, 4 Oct 2014 20:20:18 +0000
(21:20 +0100)
A value of '0' isn't a valid phandle, so searching for a node with that
phandle is pointless. It will result in nothing but false positives.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
drivers/of/base.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/of/base.c
b/drivers/of/base.c
index 293ed4b687ba7265889002edcb4f01b7d7edfe21..2305dc0382bca0a5c86bc89f5335253de46ff109 100644
(file)
--- a/
drivers/of/base.c
+++ b/
drivers/of/base.c
@@
-1021,6
+1021,9
@@
struct device_node *of_find_node_by_phandle(phandle handle)
struct device_node *np;
unsigned long flags;
+ if (!handle)
+ return NULL;
+
raw_spin_lock_irqsave(&devtree_lock, flags);
for (np = of_allnodes; np; np = np->allnext)
if (np->phandle == handle)