From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LLeyT-0000mt-TN for qemu-devel@nongnu.org; Sat, 10 Jan 2009 09:38:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LLeyR-0000mh-Ok for qemu-devel@nongnu.org; Sat, 10 Jan 2009 09:38:04 -0500 Received: from [199.232.76.173] (port=59181 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LLeyR-0000me-Lm for qemu-devel@nongnu.org; Sat, 10 Jan 2009 09:38:03 -0500 Received: from savannah.gnu.org ([199.232.41.3]:32842 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LLeyR-0002FV-C6 for qemu-devel@nongnu.org; Sat, 10 Jan 2009 09:38:03 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LLeyQ-0005DJ-Ai for qemu-devel@nongnu.org; Sat, 10 Jan 2009 14:38:02 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LLeyP-0005DF-Mi for qemu-devel@nongnu.org; Sat, 10 Jan 2009 14:38:02 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Sat, 10 Jan 2009 14:38:01 +0000 Subject: [Qemu-devel] [6267] Fix segfault Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6267 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6267 Author: blueswir1 Date: 2009-01-10 14:38:00 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Fix segfault Modified Paths: -------------- trunk/hw/sun4m.c Modified: trunk/hw/sun4m.c =================================================================== --- trunk/hw/sun4m.c 2009-01-10 11:33:32 UTC (rev 6266) +++ trunk/hw/sun4m.c 2009-01-10 14:38:00 UTC (rev 6267) @@ -533,8 +533,9 @@ tcx_init(ds, hwdef->tcx_base, phys_ram_base + tcx_offset, tcx_offset, hwdef->vram_size, graphic_width, graphic_height, graphic_depth); - if (nd_table[0].model == NULL - || strcmp(nd_table[0].model, "lance") == 0) { + if (nd_table[0].model == NULL) + nd_table[0].model = "lance"; + if (strcmp(nd_table[0].model, "lance") == 0) { lance_init(&nd_table[0], hwdef->le_base, ledma, *ledma_irq, le_reset); } else if (strcmp(nd_table[0].model, "?") == 0) { fprintf(stderr, "qemu: Supported NICs: lance\n"); @@ -1325,8 +1326,9 @@ tcx_init(ds, hwdef->tcx_base, phys_ram_base + tcx_offset, tcx_offset, hwdef->vram_size, graphic_width, graphic_height, graphic_depth); - if (nd_table[0].model == NULL - || strcmp(nd_table[0].model, "lance") == 0) { + if (nd_table[0].model == NULL) + nd_table[0].model = "lance"; + if (strcmp(nd_table[0].model, "lance") == 0) { lance_init(&nd_table[0], hwdef->le_base, ledma, *ledma_irq, le_reset); } else if (strcmp(nd_table[0].model, "?") == 0) { fprintf(stderr, "qemu: Supported NICs: lance\n"); @@ -1540,8 +1542,9 @@ tcx_init(ds, hwdef->tcx_base, phys_ram_base + tcx_offset, tcx_offset, hwdef->vram_size, graphic_width, graphic_height, graphic_depth); - if (nd_table[0].model == NULL - || strcmp(nd_table[0].model, "lance") == 0) { + if (nd_table[0].model == NULL) + nd_table[0].model = "lance"; + if (strcmp(nd_table[0].model, "lance") == 0) { lance_init(&nd_table[0], hwdef->le_base, ledma, *ledma_irq, le_reset); } else if (strcmp(nd_table[0].model, "?") == 0) { fprintf(stderr, "qemu: Supported NICs: lance\n");