Skip to content

Commit

Permalink
linux-user: Do not call get_errno() in do_brk()
Browse files Browse the repository at this point in the history
Later the returned value is compared with -1, and negated errno is not
expected.

Fixes: 00faf08 ("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>
  • Loading branch information
akihikodaki authored and rth7680 committed Aug 6, 2023
1 parent ddcdd8c commit 0692f68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0692f68

Please sign in to comment.