[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 03/14] linux-user: Do not call get_errno() in do_brk()
From: |
Richard Henderson |
Subject: |
[PATCH v7 03/14] linux-user: Do not call get_errno() in do_brk() |
Date: |
Wed, 2 Aug 2023 18:52:51 -0700 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
Later the returned value is compared with -1, and negated errno is not
expected.
Fixes: 00faf08c95 ("linux-user: Don't use MAP_FIXED in do_brk()")
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230802071754.14876-4-akihiko.odaki@daynix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/syscall.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 95727a816a..b9d2ec02f9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -862,9 +862,9 @@ abi_long do_brk(abi_ulong brk_val)
*/
if (new_host_brk_page > brk_page) {
new_alloc_size = new_host_brk_page - brk_page;
- mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size,
- PROT_READ|PROT_WRITE,
- MAP_ANON|MAP_PRIVATE, 0, 0));
+ mapped_addr = target_mmap(brk_page, new_alloc_size,
+ PROT_READ|PROT_WRITE,
+ MAP_ANON|MAP_PRIVATE, 0, 0);
} else {
new_alloc_size = 0;
mapped_addr = brk_page;
--
2.34.1
- [PATCH v7 00/14] linux-user: brk fixes, Richard Henderson, 2023/08/02
- [PATCH v7 02/14] linux-user: Fix MAP_FIXED_NOREPLACE on old kernels, Richard Henderson, 2023/08/02
- [PATCH v7 03/14] linux-user: Do not call get_errno() in do_brk(),
Richard Henderson <=
- [PATCH v7 01/14] linux-user: Unset MAP_FIXED_NOREPLACE for host, Richard Henderson, 2023/08/02
- [PATCH v7 05/14] linux-user: Do nothing if too small brk is specified, Richard Henderson, 2023/08/02
- [PATCH v7 04/14] linux-user: Use MAP_FIXED_NOREPLACE for do_brk(), Richard Henderson, 2023/08/02
- [PATCH v7 07/14] linux-user: Remove last_brk, Richard Henderson, 2023/08/02
- [PATCH v7 08/14] bsd-user: Remove last_brk, Richard Henderson, 2023/08/02
- [PATCH v7 09/14] linux-user: Adjust task_unmapped_base for reserved_va, Richard Henderson, 2023/08/02
- [PATCH v7 06/14] linux-user: Do not align brk with host page size, Richard Henderson, 2023/08/02
- [PATCH v7 10/14] linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h, Richard Henderson, 2023/08/02
- [PATCH v7 11/14] linux-user: Add ELF_ET_DYN_BASE, Richard Henderson, 2023/08/02
- [PATCH v7 13/14] linux-user: Adjust initial brk when interpreter is close to executable, Richard Henderson, 2023/08/02