From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NYR6o-0005PZ-Ii for qemu-devel@nongnu.org; Fri, 22 Jan 2010 16:32:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NYR6k-0005Ot-J6 for qemu-devel@nongnu.org; Fri, 22 Jan 2010 16:32:02 -0500 Received: from [199.232.76.173] (port=41320 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NYR6k-0005Oq-Eh for qemu-devel@nongnu.org; Fri, 22 Jan 2010 16:31:58 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:58662) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NYR6k-0002TU-3Z for qemu-devel@nongnu.org; Fri, 22 Jan 2010 16:31:58 -0500 Received: by fxm22 with SMTP id 22so1694532fxm.2 for ; Fri, 22 Jan 2010 13:31:57 -0800 (PST) From: Artyom Tarasenko Date: Fri, 22 Jan 2010 22:31:53 +0100 Message-Id: <1264195913-10897-1-git-send-email-atar4qemu@google.com> Subject: [Qemu-devel] sparc32 fix np dereference in do_unassigned_access List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Artyom Tarasenko fix a potential null pointer dereference introduced in commit 576c2cdc767ab9e2dc038fa4c99f22e53287a3de Signed-off-by: Artyom Tarasenko --- diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index ce8c6f1..eb4f5a4 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -3761,13 +3761,14 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, else raise_exception(TT_DATA_ACCESS); } - env = saved_env; /* flush neverland mappings created during no-fault mode, so the sequential MMU faults report proper fault types */ if (env->mmuregs[0] & MMU_NF) { tlb_flush(env, 1); } + + env = saved_env; } #else void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,