linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@intel.com>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 Wei Xu <weixugc@google.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	 linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/demotion: Fix NULL vs IS_ERR checking in memory_tier_init
Date: Thu, 10 Nov 2022 11:09:34 +0800	[thread overview]
Message-ID: <874jv7wln5.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <20221110030751.1627266-1-linmq006@gmail.com> (Miaoqian Lin's message of "Thu, 10 Nov 2022 07:07:51 +0400")

Miaoqian Lin <linmq006@gmail.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@gmail.com>

Thanks!

Reviewed-by: "Huang, Ying" <ying.huang@intel.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__);
>  
>  	/*


      reply	other threads:[~2022-11-10  3:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10  3:07 Miaoqian Lin
2022-11-10  3:09 ` Huang, Ying [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=874jv7wln5.fsf@yhuang6-desk2.ccr.corp.intel.com \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=linmq006@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=weixugc@google.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