From: Alistair Popple <apopple@nvidia.com>
To: liuqiangneo@163.com
Cc: jgg@ziepe.ca, leon@kernel.org, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Qiang Liu <liuqiang@kylinos.cn>
Subject: Re: [PATCH] lib/test_hmm: fix error path in dmirror_devmem_fault()
Date: Fri, 15 May 2026 15:53:21 +1000 [thread overview]
Message-ID: <aga0TE2s-NldUtsk@nvdebian.thelocal> (raw)
In-Reply-To: <20260514025328.21175-1-liuqiangneo@163.com>
On 2026-05-14 at 12:53 +1000, liuqiangneo@163.com wrote...
> From: Qiang Liu <liuqiang@kylinos.cn>
>
> Handle migrate_vma_setup() failure via goto err for unified cleanup.
In practice migrate_vma_setup() should never fail unless the test is wrong as it
just tests some static VMA properties. It might be nice to add a comment to that
effect, but the fix looks good so feel free to add:
Reviewed-by: Alistair Popple <apopple@nvidia.com>
- Alistair
> Signed-off-by: Qiang Liu <liuqiang@kylinos.cn>
> ---
> lib/test_hmm.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/test_hmm.c b/lib/test_hmm.c
> index 213504915737..5430ef97bbe0 100644
> --- a/lib/test_hmm.c
> +++ b/lib/test_hmm.c
> @@ -1679,8 +1679,10 @@ static vm_fault_t dmirror_devmem_fault(struct vm_fault *vmf)
> if (order)
> args.flags |= MIGRATE_VMA_SELECT_COMPOUND;
>
> - if (migrate_vma_setup(&args))
> - return VM_FAULT_SIGBUS;
> + if (migrate_vma_setup(&args)) {
> + ret = VM_FAULT_SIGBUS;
> + goto err;
> + }
>
> ret = dmirror_devmem_fault_alloc_and_copy(&args, dmirror);
> if (ret)
> --
> 2.43.0
>
>
prev parent reply other threads:[~2026-05-15 5:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 2:53 [PATCH] lib/test_hmm: fix error path in dmirror_devmem_fault() liuqiangneo
2026-05-15 5:53 ` Alistair Popple [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=aga0TE2s-NldUtsk@nvdebian.thelocal \
--to=apopple@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuqiang@kylinos.cn \
--cc=liuqiangneo@163.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 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.