mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Wang Ming <machel@vivo.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>, Alan Tull <atull@kernel.org>,
	Richard Gong <richard.gong@intel.com>,
	linux-kernel@vger.kernel.org, opensource.kernel@vivo.com
Subject: Re: [PATCH v2] firmware: Fix an NULL vs IS_ERR() bug in probe
Date: Sun, 16 Jul 2023 07:44:07 +0200	[thread overview]
Message-ID: <2023071643-anthill-snowdrift-f1f6@gregkh> (raw)
In-Reply-To: <20230716015310.12293-1-machel@vivo.com>

On Sun, Jul 16, 2023 at 09:52:57AM +0800, Wang Ming wrote:
> The devm_memremap() function returns error pointers.
> It never returns NULL. Fix the check.
> 
> Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
> Signed-off-by: Wang Ming <machel@vivo.com>
> ---
>  drivers/firmware/stratix10-svc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
> index 2d674126160f..935bc0cf913f 100644
> --- a/drivers/firmware/stratix10-svc.c
> +++ b/drivers/firmware/stratix10-svc.c
> @@ -756,7 +756,8 @@ svc_create_memory_pool(struct platform_device *pdev,
>  	paddr = begin;
>  	size = end - begin;
>  	va = devm_memremap(dev, paddr, size, MEMREMAP_WC);
> -	if (!va) {
> +
> +	if (IS_ERR(va)) {

Why did you add an extra blank line?


      reply	other threads:[~2023-07-16  5:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16  1:52 Wang Ming
2023-07-16  5:44 ` Greg Kroah-Hartman [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=2023071643-anthill-snowdrift-f1f6@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=atull@kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=machel@vivo.com \
    --cc=opensource.kernel@vivo.com \
    --cc=richard.gong@intel.com \
    /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

all inboxes | Powered by JetHome®