linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: YueHaibing <yuehaibing@huawei.com>,
	sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com,
	akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/zswap: Fix passing zero to 'PTR_ERR' warning
Date: Mon, 2 Nov 2020 11:21:32 +0100	[thread overview]
Message-ID: <6926f3a4-05df-70a6-7a56-4405e10cb9f3@redhat.com> (raw)
In-Reply-To: <20201031055615.28080-1-yuehaibing@huawei.com>

On 31.10.20 06:56, YueHaibing wrote:
> Fix smatch warning:
> 
> mm/zswap.c:425 zswap_cpu_comp_prepare() warn: passing zero to 'PTR_ERR'
> 
> crypto_alloc_comp() never return NULL, use IS_ERR
> instead of IS_ERR_OR_NULL to fix this.
> 
> Fixes: f1c54846ee45 ("zswap: dynamic pool creation")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>   mm/zswap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 1eced701b3bd..55a2f72557a8 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -421,7 +421,7 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
>   		return 0;
>   
>   	tfm = crypto_alloc_comp(pool->tfm_name, 0, 0);
> -	if (IS_ERR_OR_NULL(tfm)) {
> +	if (IS_ERR(tfm)) {
>   		pr_err("could not alloc crypto comp %s : %ld\n",
>   		       pool->tfm_name, PTR_ERR(tfm));
>   		return -ENOMEM;
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



      reply	other threads:[~2020-11-02 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31  5:56 [PATCH] mm/zswap: Fix passing zero to 'PTR_ERR' warning YueHaibing
2020-11-02 10:21 ` David Hildenbrand [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=6926f3a4-05df-70a6-7a56-4405e10cb9f3@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ddstreet@ieee.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sjenning@redhat.com \
    --cc=vitaly.wool@konsulko.com \
    --cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).