[PATCH] fixup: return error on broken path, update vma_internal.h

From: Lorenzo Stoakes

Date: Thu Sep 18 2025 - 03:08:31 EST


Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
---
mm/util.c | 6 ++++--
tools/testing/vma/vma_internal.h | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mm/util.c b/mm/util.c
index 0c1c68285675..30ed284bb819 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -1385,17 +1385,19 @@ EXPORT_SYMBOL(mmap_action_prepare);
int mmap_action_complete(struct mmap_action *action,
struct vm_area_struct *vma)
{
+ int err = 0;
+
switch (action->type) {
case MMAP_NOTHING:
break;
case MMAP_REMAP_PFN:
case MMAP_IO_REMAP_PFN:
WARN_ON_ONCE(1); /* nommu cannot handle this. */
-
+ err = -EINVAL;
break;
}

- return mmap_action_finish(action, vma, /* err = */0);
+ return mmap_action_finish(action, vma, err);
}
EXPORT_SYMBOL(mmap_action_complete);
#endif
diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h
index 22ed38e8714e..d5028e5e905b 100644
--- a/tools/testing/vma/vma_internal.h
+++ b/tools/testing/vma/vma_internal.h
@@ -279,6 +279,7 @@ struct vm_area_struct;
enum mmap_action_type {
MMAP_NOTHING, /* Mapping is complete, no further action. */
MMAP_REMAP_PFN, /* Remap PFN range. */
+ MMAP_IO_REMAP_PFN, /* I/O remap PFN range. */
};

/*
--
2.51.0