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] [day] [month] [year] [list]
Message-ID: <20190301190721.GA27005@builder>
Date:   Fri, 1 Mar 2019 11:07:21 -0800
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Andy Gross <andy.gross@...aro.org>,
        Mahesh Sivasubramanian <msivasub@...eaurora.org>,
        David Brown <david.brown@...aro.org>,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] soc: qcom: cmd-db: Fix an error code in
 cmd_db_dev_probe()

On Wed 27 Feb 21:48 PST 2019, Dan Carpenter wrote:

> The memremap() function doesn't return error pointers, it returns NULL.
> This code is returning "ret = PTR_ERR(NULL);" which is success, but it
> should return -ENOMEM.
> 
> Fixes: 312416d9171a ("drivers: qcom: add command DB driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---

Thanks Dan, picking this up.

Regards,
Bjorn

>  drivers/soc/qcom/cmd-db.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
> index c701b3b010f1..f6c3d17b05c7 100644
> --- a/drivers/soc/qcom/cmd-db.c
> +++ b/drivers/soc/qcom/cmd-db.c
> @@ -248,8 +248,8 @@ static int cmd_db_dev_probe(struct platform_device *pdev)
>  	}
>  
>  	cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WB);
> -	if (IS_ERR_OR_NULL(cmd_db_header)) {
> -		ret = PTR_ERR(cmd_db_header);
> +	if (!cmd_db_header) {
> +		ret = -ENOMEM;
>  		cmd_db_header = NULL;
>  		return ret;
>  	}
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ