diff --git a/kernel/syscall.c b/kernel/syscall.c index 0803d26a..1f085629 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -7736,6 +7736,14 @@ SYSCALL_DECLARE(mremap) goto out; } + /* check necessity of remap */ + if (!(flags & MREMAP_FIXED) && oldsize == newsize) { + /* Nothing to do */ + error = 0; + newstart = oldaddr; + goto out; + } + if (oldend < oldstart) { error = -EINVAL; ekprintf("sys_mremap(%#lx,%#lx,%#lx,%#x,%#lx):"