From: blueswir1 Date: Sat, 10 Jan 2009 14:38:00 +0000 (+0000) Subject: Fix segfault X-Git-Tag: stefano.display-merge-end~174 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6ea52595474e16888d10eec310b0d156f8bbabc1;p=qemu-xen-4.6-testing.git Fix segfault git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6267 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/hw/sun4m.c b/hw/sun4m.c index e6a538a9f..b7bd51f39 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -533,8 +533,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size, 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 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, 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 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size, 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");