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: <874jv7wln5.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date:   Thu, 10 Nov 2022 11:09:34 +0800
From:   "Huang, Ying" <ying.huang@...el.com>
To:     Miaoqian Lin <linmq006@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Wei Xu <weixugc@...gle.com>,
        "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/demotion: Fix NULL vs IS_ERR checking in
 memory_tier_init

Miaoqian Lin <linmq006@...il.com> writes:

> The alloc_memory_type() function return error pointers on error
> instead of NULL.
> Use IS_ERR() to check the return value to fix this.
>
> Fixes: 7b88bda3761b ("mm/demotion/dax/kmem: set node's abstract distance to MEMTIER_DEFAULT_DAX_ADISTANCE")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>

Thanks!

Reviewed-by: "Huang, Ying" <ying.huang@...el.com>

> ---
>  mm/memory-tiers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
> index fa8c9d07f9ce..ac0dae9e54bf 100644
> --- a/mm/memory-tiers.c
> +++ b/mm/memory-tiers.c
> @@ -645,7 +645,7 @@ static int __init memory_tier_init(void)
>  	 * than default DRAM tier.
>  	 */
>  	default_dram_type = alloc_memory_type(MEMTIER_ADISTANCE_DRAM);
> -	if (!default_dram_type)
> +	if (IS_ERR(default_dram_type))
>  		panic("%s() failed to allocate default DRAM tier\n", __func__);
>  
>  	/*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ