All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Christian <nigel.l.christian@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm: hugetlb: checking for IS_ERR() instead of NULL
Date: Tue, 1 Jun 2021 13:54:11 -0400	[thread overview]
Message-ID: <YLZ0Q6S2A9kxXk6c@fedora> (raw)
In-Reply-To: <YLX9FCOU0Il8Ejoy@mwanda>

On Tue, Jun 01, 2021 at 12:25:40PM +0300, Dan Carpenter wrote:
> The alloc_migrate_huge_page() doesn't return error pointers, it returns
> NULL.

Hi Dan,

I'm trying to start using smatch. Is this in the warns report?
Wasn't able to find using smatch_scripts/kchecker mm/hugetlb.c (T_T)

> 
> Fixes: ab45bc8b5910 ("mm, hugetlb: fix resv_huge_pages underflow on UFFDIO_COPY")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  mm/hugetlb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 69a4b551c157..3221c94b4749 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -5103,7 +5103,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
>  			 */
>  			page = alloc_migrate_huge_page(h, gfp_mask, node,
>  						       nodemask);
> -			if (IS_ERR(page)) {
> +			if (!page) {
>  				ret = -ENOMEM;
>  				goto out;
>  			}
> -- 
> 2.30.2
> 

  parent reply	other threads:[~2021-06-01 17:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  9:25 [PATCH] mm: hugetlb: checking for IS_ERR() instead of NULL Dan Carpenter
2021-06-01 10:52 ` Mina Almasry
2021-06-01 17:54 ` Nigel Christian [this message]
2021-06-01 19:00   ` Dan Carpenter
2021-06-01 19:51     ` Dan Carpenter
2021-06-01 20:50       ` Dan Carpenter
2021-06-01 21:23         ` Nigel Christian
2021-06-02  6:11           ` Dan Carpenter
2021-06-02 14:47         ` Dan Carpenter
2021-06-02 16:01           ` Nigel Christian
2021-06-04 13:34           ` Dan Carpenter
2021-06-04 14:14             ` Nigel Christian
2021-06-04 14:21               ` Dan Carpenter
2021-06-02 14:22       ` Dan Carpenter
2021-06-02 15:57         ` Nigel Christian

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=YLZ0Q6S2A9kxXk6c@fedora \
    --to=nigel.l.christian@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.