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]
Date:   Mon, 2 Nov 2020 11:21:32 +0100
From:   David Hildenbrand <david@...hat.com>
To:     YueHaibing <yuehaibing@...wei.com>, sjenning@...hat.com,
        ddstreet@...e.org, vitaly.wool@...sulko.com,
        akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/zswap: Fix passing zero to 'PTR_ERR' warning

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@...wei.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@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ