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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 21 Mar 2016 11:54:03 +0000
From:	Lee Jones <lee.jones@...aro.org>
To:	Vladimir Zapolskiy <vz@...ia.com>
Cc:	Bjorn Andersson <bjorn.andersson@...aro.org>,
	Ohad Ben-Cohen <ohad@...ery.com>,
	Ludovic Barre <ludovic.barre@...com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] remoteproc: st: fix check of
 syscon_regmap_lookup_by_phandle() return value

On Sat, 19 Mar 2016, Vladimir Zapolskiy wrote:

> syscon_regmap_lookup_by_phandle() returns either a valid pointer to
> struct regmap or ERR_PTR() error value, check for NULL is invalid and
> on error path may lead to oops, the change corrects the check.
> 
> Signed-off-by: Vladimir Zapolskiy <vz@...ia.com>
> ---
>  drivers/remoteproc/st_remoteproc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Lee Jones <lee.jones@...aro.org>

> diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
> index 6bb04d4..6f056ca 100644
> --- a/drivers/remoteproc/st_remoteproc.c
> +++ b/drivers/remoteproc/st_remoteproc.c
> @@ -189,9 +189,9 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
>  	}
>  
>  	ddata->boot_base = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
> -	if (!ddata->boot_base) {
> +	if (IS_ERR(ddata->boot_base)) {
>  		dev_err(dev, "Boot base not found\n");
> -		return -EINVAL;
> +		return PTR_ERR(ddata->boot_base);
>  	}
>  
>  	err = of_property_read_u32_index(np, "st,syscfg", 1,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ