[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 02/13] signal/x86/setup_frame: __put_user cleanup
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH v3 02/13] signal/x86/setup_frame: __put_user cleanup |
Date: |
Tue, 10 Jun 2014 16:20:31 +0300 |
From: Riku Voipio <address@hidden>
Remove the remaining check for __put_user return
value, and all the checks for err variable which
isn't set anywhere anymore.
No we can only end up in give_sigsegv due to failed
lock_user_struct - thus we remove the unlock_user_struct
to avoid unlocking a region never locked.
Signed-off-by: Riku Voipio <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
---
linux-user/signal.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 00a02e1..cf283a8 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -911,7 +911,7 @@ static void setup_frame(int sig, struct target_sigaction
*ka,
{
abi_ulong frame_addr;
struct sigframe *frame;
- int i, err = 0;
+ int i;
frame_addr = get_sigframe(ka, env, sizeof(*frame));
@@ -920,18 +920,13 @@ static void setup_frame(int sig, struct target_sigaction
*ka,
__put_user(current_exec_domain_sig(sig),
&frame->sig);
- if (err)
- goto give_sigsegv;
setup_sigcontext(&frame->sc, &frame->fpstate, env, set->sig[0],
frame_addr + offsetof(struct sigframe, fpstate));
- if (err)
- goto give_sigsegv;
- for(i = 1; i < TARGET_NSIG_WORDS; i++) {
- if (__put_user(set->sig[i], &frame->extramask[i - 1]))
- goto give_sigsegv;
- }
+ for(i = 1; i < TARGET_NSIG_WORDS; i++) {
+ __put_user(set->sig[i], &frame->extramask[i - 1]);
+ }
/* Set up to return from userspace. If provided, use a stub
already in userspace. */
@@ -950,8 +945,6 @@ static void setup_frame(int sig, struct target_sigaction
*ka,
__put_user(val16, (uint16_t *)(frame->retcode+6));
}
- if (err)
- goto give_sigsegv;
/* Set up registers for signal handler */
env->regs[R_ESP] = frame_addr;
@@ -968,7 +961,6 @@ static void setup_frame(int sig, struct target_sigaction
*ka,
return;
give_sigsegv:
- unlock_user_struct(frame, frame_addr, 1);
if (sig == TARGET_SIGSEGV)
ka->_sa_handler = TARGET_SIG_DFL;
force_sig(TARGET_SIGSEGV /* , current */);
--
2.0.0.rc2
- [Qemu-devel] [PATCH v3 00/13] linux-user: __{get, put}_user return value cleanup, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 02/13] signal/x86/setup_frame: __put_user cleanup,
riku . voipio <=
- [Qemu-devel] [PATCH v3 12/13] signal/ppc/do_setcontext remove __get_user return check, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 13/13] linux-user: fix gcc-4.9 compiler error on __{get, put]}_user, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 07/13] signal/all/do_sigaltstack remove __get_user value check, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 03/13] signal/all: remove return value from copy_siginfo_to_user, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 10/13] signal/ppc/{save, restore}_user_regs remove __put/get error checks, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 04/13] signal/all: remove return value from setup_sigcontext, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 08/13] signal/all/do_sigreturn - remove __get_user checks, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 09/13] signal/all/setup_frame remove __put_user checks, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 01/13] signal/all: remove __get/__put_user return value reading, riku . voipio, 2014/06/10
- [Qemu-devel] [PATCH v3 06/13] signal/sparc/restore_fpu_state: remove, riku . voipio, 2014/06/10