Message ID | 20230801232745.4125-5-deller@gmx.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | linux-user: brk fixes | expand |
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ac429a185a..ebdc8c144c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -820,14 +820,14 @@ abi_long do_brk(abi_ulong brk_val) /* brk pointers are always untagged */ - /* return old brk value if brk_val unchanged or zero */ - if (!brk_val || brk_val == target_brk) { + /* return old brk value if brk_val unchanged */ + if (brk_val == target_brk) { return target_brk; } /* do not allow to shrink below initial brk value */ if (brk_val < initial_target_brk) { - brk_val = initial_target_brk; + return target_brk; } new_brk = TARGET_PAGE_ALIGN(brk_val);