Received: from eggs.gnu.org ([208.118.235.92]:54016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIy3V-00082r-SO for qemu-devel@nongnu.org; Fri, 22 Mar 2013 05:14:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIy3U-0004iW-C3 for qemu-devel@nongnu.org; Fri, 22 Mar 2013 05:14:33 -0400 From: liguang Date: Fri, 22 Mar 2013 17:12:31 +0800 Message-Id: <1363943551-31150-1-git-send-email-lig.fnst@cn.fujitsu.com> Subject: [Qemu-devel] [PATCH] hw/i386/pc: fix possible segment fault for port92_write List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Cc: liguang e.g. $qemu-system-x86_64 -device port92 will report segment fault, for port92_write try a un-allocated assignment for a20_out. so check before this assignment. Signed-off-by: liguang --- hw/i386/pc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ed7d9ba..a0e8ee0 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -440,7 +440,8 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val, DPRINTF("port92: write 0x%02x\n", val); s->outport = val; - qemu_set_irq(*s->a20_out, (val >> 1) & 1); + if (s->a20_out) + qemu_set_irq(*s->a20_out, (val >> 1) & 1); if (val & 1) { qemu_system_reset_request(); } -- 1.7.2.5