Skip to contentSkip to conversation

linux-user/signal.c: Skip calling unlock_user_struct() when lock_user_struct() failed for target m68k

PATCH New [email protected] 1 participant 1 message Sep 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user/signal.c: Skip calling unlock_user_struct() when lock_user_struct() failed for target m68k

From: Chen Gang <[email protected]>

For target m68k, setup_rt_frame() and do_rt_sigreturn() have this issue.

---
 linux-user/signal.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
linux-user/signal.c +4 -2
index cead97b..0265c46 100644
@@ -5160,7 +5160,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
 
     frame_addr = get_sigframe(ka, env, sizeof *frame);
     if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0))
-	goto give_sigsegv;
+        goto err;
 
     __put_user(sig, &frame->sig);
 
@@ -5215,6 +5215,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
 
 give_sigsegv:
     unlock_user_struct(frame, frame_addr, 1);
+err:
     force_sig(TARGET_SIGSEGV);
 }
 
@@ -5261,7 +5262,7 @@ long do_rt_sigreturn(CPUM68KState *env)
     int d0;
 
     if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))
-        goto badframe;
+        goto err;
 
     target_to_host_sigset_internal(&set, &target_set);
     do_sigprocmask(SIG_SETMASK, &set, NULL);
@@ -5281,6 +5282,7 @@ long do_rt_sigreturn(CPUM68KState *env)
 
 badframe:
     unlock_user_struct(frame, frame_addr, 0);
+err:
     force_sig(TARGET_SIGSEGV);
     return 0;
 }
Signature · 1 line
1.9.3