From: liuqiangneo@163.com
To: jgg@ziepe.ca, leon@kernel.org
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Qiang Liu <liuqiang@kylinos.cn>
Subject: [PATCH] lib/test_hmm: fix error path in dmirror_devmem_fault()
Date: Thu, 14 May 2026 10:53:27 +0800 [thread overview]
Message-ID: <20260514025328.21175-1-liuqiangneo@163.com> (raw)
From: Qiang Liu <liuqiang@kylinos.cn>
Handle migrate_vma_setup() failure via goto err for unified cleanup.
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
next reply other threads:[~2026-05-14 2:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 2:53 liuqiangneo [this message]
2026-05-15 5:53 ` [PATCH] lib/test_hmm: fix error path in dmirror_devmem_fault() Alistair Popple
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=20260514025328.21175-1-liuqiangneo@163.com \
--to=liuqiangneo@163.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 \
/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