qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] linux-user: Fix uninitialized variables
@ 2014-03-12 13:05 Peter Maydell
  2014-03-12 13:06 ` [Qemu-devel] [PATCH 1/2] linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn Peter Maydell
  2014-03-12 13:06 ` [Qemu-devel] [PATCH 2/2] linux-user: Don't return uninitialized value for atomic_barrier syscall Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2014-03-12 13:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, patches

Fix a couple of uses of uninitialized variables in linux-user;
both spotted by clang as compile warnings.

Peter Maydell (2):
  linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn
  linux-user: Don't return uninitialized value for atomic_barrier
    syscall

 linux-user/signal.c  | 2 +-
 linux-user/syscall.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
1.9.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 1/2] linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn
  2014-03-12 13:05 [Qemu-devel] [PATCH 0/2] linux-user: Fix uninitialized variables Peter Maydell
@ 2014-03-12 13:06 ` Peter Maydell
  2014-03-12 13:06 ` [Qemu-devel] [PATCH 2/2] linux-user: Don't return uninitialized value for atomic_barrier syscall Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2014-03-12 13:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, patches

The error path in AArch64 do_rt_sigreturn() which fails before
attempting lock_user_struct() was doing an unlock_user_struct()
on an uninitialized variable. Initialize frame to NULL so we
can use the same error-exit path in all cases (unlock of NULL
is permitted and does nothing).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index c8a1da0..8c4a32d 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -1334,7 +1334,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
 
 long do_rt_sigreturn(CPUARMState *env)
 {
-    struct target_rt_sigframe *frame;
+    struct target_rt_sigframe *frame = NULL;
     abi_ulong frame_addr = env->xregs[31];
 
     if (frame_addr & 15) {
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] linux-user: Don't return uninitialized value for atomic_barrier syscall
  2014-03-12 13:05 [Qemu-devel] [PATCH 0/2] linux-user: Fix uninitialized variables Peter Maydell
  2014-03-12 13:06 ` [Qemu-devel] [PATCH 1/2] linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn Peter Maydell
@ 2014-03-12 13:06 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2014-03-12 13:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, patches

QEMU's implementation of the m68k atomic_barrier syscall, like the kernel's,
is just a no-op. However we still need to return a result code from it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e2c10cc..19317eb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9142,6 +9142,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_atomic_barrier:
     {
         /* Like the kernel implementation and the qemu arm barrier, no-op this? */
+        ret = 0;
         break;
     }
 #endif
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-12 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 13:05 [Qemu-devel] [PATCH 0/2] linux-user: Fix uninitialized variables Peter Maydell
2014-03-12 13:06 ` [Qemu-devel] [PATCH 1/2] linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn Peter Maydell
2014-03-12 13:06 ` [Qemu-devel] [PATCH 2/2] linux-user: Don't return uninitialized value for atomic_barrier syscall Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).