public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: of: check input parameter name for __of_find_property
@ 2015-09-11 13:44 Peng Fan
  2015-09-15 15:56 ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Fan @ 2015-09-11 13:44 UTC (permalink / raw)
  To: robh+dt; +Cc: devicetree, van.freenix, linux-kernel, Frank Rowand, Grant Likely

Check input parameter 'name' for __of_find_property. If name is NULL,
of_prop_cmp->strcasecmp may trigger panic.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Grant Likely <grant.likely@linaro.org>
---
 drivers/of/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 8b5a187..e41436d 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -215,7 +215,7 @@ static struct property *__of_find_property(const struct device_node *np,
 {
 	struct property *pp;
 
-	if (!np)
+	if (!np || !name)
 		return NULL;
 
 	for (pp = np->properties; pp; pp = pp->next) {
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-16 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 13:44 [PATCH] drivers: of: check input parameter name for __of_find_property Peng Fan
2015-09-15 15:56 ` Rob Herring
2015-09-16  0:16   ` Peng Fan
2015-09-16  2:27     ` Rob Herring
2015-09-16 13:55       ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox