lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F5F4197.4070605@gmail.com>
Date:	Tue, 13 Mar 2012 07:46:15 -0500
From:	Rob Herring <robherring2@...il.com>
To:	Dong Aisheng <b29396@...escale.com>
CC:	devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	rob.herring@...xeda.com
Subject: Re: [PATCH 1/1] of: add NULL parameter check for of_device_is_available

On 03/13/2012 06:40 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@...aro.org>
> 
> This function will return 1 even the device node passed in
> is NULL which is a little error-prone.
> Change to return 0 if the device node passed in is NULL.
> 
> Signed-off-by: Dong Aisheng <dong.aisheng@...aro.org>

Applied.

Rob

> ---
>  drivers/of/base.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 133908a..b9347d8 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -280,6 +280,9 @@ int of_device_is_available(const struct device_node *device)
>  	const char *status;
>  	int statlen;
>  
> +	if (device == NULL)
> +		return 0;
> +
>  	status = of_get_property(device, "status", &statlen);
>  	if (status == NULL)
>  		return 1;

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ