From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Subject: [PATCH] drivers: of: check input parameter name for __of_find_property Date: Fri, 11 Sep 2015 21:44:03 +0800 Message-ID: <1441979043-19694-1-git-send-email-van.freenix@gmail.com> Return-path: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, van.freenix-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frank Rowand , Grant Likely List-Id: devicetree@vger.kernel.org Check input parameter 'name' for __of_find_property. If name is NULL, of_prop_cmp->strcasecmp may trigger panic. Signed-off-by: Peng Fan Cc: Rob Herring Cc: Frank Rowand Cc: Grant Likely --- 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 devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html