From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQH5L-0007ki-I2 for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:03:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQH5G-000606-ME for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:03:11 -0400 Received: from afflict.kos.to ([92.243.29.197]:54508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQH5G-0005uw-Ef for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:03:06 -0400 From: riku.voipio@linaro.org Date: Wed, 19 Mar 2014 16:02:56 +0200 Message-Id: <7f72cd235fa33f2fc7a8d1cc4d621bf7db61e9eb.1395237255.git.riku.voipio@linaro.org> In-Reply-To: References: Subject: [Qemu-devel] [PULL for-2.0 1/7] linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori From: Peter Maydell 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 Signed-off-by: Riku Voipio --- 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 24c91f3..209855e 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1340,7 +1340,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.8.1.2