Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225372

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

From Rob Herring <robh@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] drivers: of: check input parameter name for __of_find_property
Date 2015-09-15 18:00 +0200
Message-ID <q90Og-UN-51@gated-at.bofh.it> (permalink)
References <q7wSe-3el-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 09/11/2015 08:44 AM, Peng Fan wrote:
> Check input parameter 'name' for __of_find_property. If name is NULL,
> of_prop_cmp->strcasecmp may trigger panic.

Arguably that could be a feature. Do you have a usecase where name being
NULL is valid and panicking is a problem?

Rob

> 
> 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) {
> 

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] drivers: of: check input parameter name for __of_find_property Peng Fan <van.freenix@gmail.com> - 2015-09-11 15:50 +0200
  Re: [PATCH] drivers: of: check input parameter name for  __of_find_property Rob Herring <robh@kernel.org> - 2015-09-15 18:00 +0200
    Re: [PATCH] drivers: of: check input parameter name for  __of_find_property Peng Fan <van.freenix@gmail.com> - 2015-09-16 02:20 +0200
      Re: [PATCH] drivers: of: check input parameter name for  __of_find_property Rob Herring <robh@kernel.org> - 2015-09-16 04:30 +0200
        Re: [PATCH] drivers: of: check input parameter name for  __of_find_property Peng Fan <van.freenix@gmail.com> - 2015-09-16 16:00 +0200

csiph-web