[PATCH] drivers: of: check input parameter name for __of_find_property

From: Peng Fan
Date: Fri Sep 11 2015 - 09:43:36 EST


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@xxxxxxxxx>
Cc: Rob Herring <robh+dt@xxxxxxxxxx>
Cc: Frank Rowand <frowand.list@xxxxxxxxx>
Cc: Grant Likely <grant.likely@xxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/