public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Andy Gross <andy.gross@linaro.org>,
	Mahesh Sivasubramanian <msivasub@codeaurora.org>,
	David Brown <david.brown@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: cmd-db: Fix an error code in cmd_db_dev_probe()
Date: Fri, 1 Mar 2019 11:07:21 -0800	[thread overview]
Message-ID: <20190301190721.GA27005@builder> (raw)
In-Reply-To: <20190228054849.GD3253@kadam>

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@oracle.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
> 

      reply	other threads:[~2019-03-01 19:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28  5:48 [PATCH] soc: qcom: cmd-db: Fix an error code in cmd_db_dev_probe() Dan Carpenter
2019-03-01 19:07 ` Bjorn Andersson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190301190721.GA27005@builder \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=dan.carpenter@oracle.com \
    --cc=david.brown@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msivasub@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox