From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VALJg-0004mH-0V for qemu-devel@nongnu.org; Fri, 16 Aug 2013 10:47:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VALJb-0001O6-Bu for qemu-devel@nongnu.org; Fri, 16 Aug 2013 10:47:51 -0400 From: Anthony PERARD Date: Fri, 16 Aug 2013 15:46:49 +0100 Message-ID: <1376664409-2695-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH for v1.6] pc: Fix initialization of the ram_memory variable. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU-devel Cc: qemu-trivial@nongnu.org, Anthony PERARD , Stefano Stabellini , Xen Devel In some cases (Xen), it will not be initialized before to be used. This leads to segv. Signed-off-by: Anthony PERARD --- It works with this simple initialization to NULL, but would it be necessary (or better) to assign a proper value to this variables ? --- hw/i386/pc_piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 6e1e654..596d433 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -86,7 +86,7 @@ static void pc_init1(MemoryRegion *system_memory, BusState *idebus[MAX_IDE_BUS]; ISADevice *rtc_state; ISADevice *floppy; - MemoryRegion *ram_memory; + MemoryRegion *ram_memory = NULL; MemoryRegion *pci_memory; MemoryRegion *rom_memory; DeviceState *icc_bridge; -- Anthony PERARD