Skip to contentSkip to conversation

bsd-user: correct notion of return value

PATCH New Maya Rashish 1 participant 1 message Apr 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 bsd-user: correct notion of return value

Fix EFAULT at startup.

---
 bsd-user/netbsd/target_os_stack.h  | 2 +-
 bsd-user/openbsd/target_os_stack.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
bsd-user/netbsd/target_os_stack.h +1 -1
index 503279c1a9..f3cfbe8626 100644
@@ -40,7 +40,7 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm, abi_ulong *p,
     for (i = 0; i < MAX_ARG_PAGES; i++) {
         if (bprm->page[i]) {
             info->rss++;
-            if (!memcpy_to_target(stack_base, bprm->page[i],
+            if (memcpy_to_target(stack_base, bprm->page[i],
                         TARGET_PAGE_SIZE)) {
                 errno = EFAULT;
                 return -1;
bsd-user/openbsd/target_os_stack.h +1 -1
index 4b37955d3b..3f799ef5d1 100644
@@ -40,7 +40,7 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm, abi_ulong *p,
     for (i = 0; i < MAX_ARG_PAGES; i++) {
         if (bprm->page[i]) {
             info->rss++;
-            if (!memcpy_to_target(stack_base, bprm->page[i],
+            if (memcpy_to_target(stack_base, bprm->page[i],
                         TARGET_PAGE_SIZE)) {
                 errno = EFAULT;
                 return -1;
Signature · 1 line
2.35.1